lock: better lock anim
This commit is contained in:
parent
e92cbd25a6
commit
acfef5103e
5 changed files with 28 additions and 21 deletions
|
|
@ -5,6 +5,8 @@ JsonObject {
|
||||||
property Sizes sizes: Sizes {}
|
property Sizes sizes: Sizes {}
|
||||||
|
|
||||||
component Sizes: JsonObject {
|
component Sizes: JsonObject {
|
||||||
|
property real heightMult: 0.7
|
||||||
|
property real ratio: 16 / 9
|
||||||
property int centerWidth: 600
|
property int centerWidth: 600
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import qs.components.images
|
||||||
import qs.services
|
import qs.services
|
||||||
import qs.config
|
import qs.config
|
||||||
import qs.utils
|
import qs.utils
|
||||||
import Quickshell
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
|
|
@ -15,9 +14,8 @@ ColumnLayout {
|
||||||
required property var lock
|
required property var lock
|
||||||
readonly property list<string> timeComponents: Time.format(Config.services.useTwelveHourClock ? "hh:mm:A" : "hh:mm").split(":")
|
readonly property list<string> timeComponents: Time.format(Config.services.useTwelveHourClock ? "hh:mm:A" : "hh:mm").split(":")
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.preferredWidth: Config.lock.sizes.centerWidth
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.minimumWidth: Config.lock.sizes.centerWidth
|
|
||||||
|
|
||||||
spacing: Appearance.spacing.large * 2
|
spacing: Appearance.spacing.large * 2
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ RowLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property var lock
|
required property var lock
|
||||||
|
property real centerScale
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Appearance.padding.large
|
anchors.margins: Appearance.padding.large
|
||||||
|
|
@ -24,6 +25,8 @@ RowLayout {
|
||||||
|
|
||||||
radius: Appearance.rounding.small
|
radius: Appearance.rounding.small
|
||||||
color: Colours.tPalette.m3surfaceContainer
|
color: Colours.tPalette.m3surfaceContainer
|
||||||
|
|
||||||
|
// WeatherInfo {}
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledRect {
|
StyledRect {
|
||||||
|
|
@ -36,6 +39,9 @@ RowLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
Center {
|
Center {
|
||||||
|
Layout.leftMargin: -(1 - scale) * implicitWidth / 2
|
||||||
|
Layout.rightMargin: -(1 - scale) * implicitWidth / 2
|
||||||
|
scale: root.centerScale
|
||||||
lock: root.lock
|
lock: root.lock
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,13 @@ WlSessionLockSurface {
|
||||||
property: "opacity"
|
property: "opacity"
|
||||||
to: 1
|
to: 1
|
||||||
}
|
}
|
||||||
|
Anim {
|
||||||
|
target: content
|
||||||
|
property: "centerScale"
|
||||||
|
to: 1
|
||||||
|
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
||||||
|
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
||||||
|
}
|
||||||
Anim {
|
Anim {
|
||||||
target: lockBg
|
target: lockBg
|
||||||
property: "radius"
|
property: "radius"
|
||||||
|
|
@ -131,14 +138,14 @@ WlSessionLockSurface {
|
||||||
Anim {
|
Anim {
|
||||||
target: lockBg
|
target: lockBg
|
||||||
property: "implicitWidth"
|
property: "implicitWidth"
|
||||||
to: root.width * 0.8
|
to: root.height * Config.lock.sizes.heightMult * Config.lock.sizes.ratio
|
||||||
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
||||||
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
||||||
}
|
}
|
||||||
Anim {
|
Anim {
|
||||||
target: lockBg
|
target: lockBg
|
||||||
property: "implicitHeight"
|
property: "implicitHeight"
|
||||||
to: root.height * 0.8
|
to: root.height * Config.lock.sizes.heightMult
|
||||||
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
||||||
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
||||||
}
|
}
|
||||||
|
|
@ -174,6 +181,7 @@ WlSessionLockSurface {
|
||||||
implicitWidth: size
|
implicitWidth: size
|
||||||
implicitHeight: size
|
implicitHeight: size
|
||||||
|
|
||||||
|
clip: true
|
||||||
color: Colours.tPalette.m3surface
|
color: Colours.tPalette.m3surface
|
||||||
radius: size / 4
|
radius: size / 4
|
||||||
rotation: 180
|
rotation: 180
|
||||||
|
|
|
||||||
|
|
@ -7,22 +7,10 @@ import QtQuick.Layouts
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
Timer {
|
anchors.fill: parent
|
||||||
running: true
|
|
||||||
triggeredOnStart: true
|
|
||||||
repeat: true
|
|
||||||
interval: 900000 // 15 minutes
|
|
||||||
onTriggered: Weather.reload()
|
|
||||||
}
|
|
||||||
|
|
||||||
spacing: Appearance.spacing.large
|
spacing: Appearance.spacing.large
|
||||||
|
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
id: icon
|
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
Layout.topMargin: Config.lock.sizes.border / 4
|
|
||||||
|
|
||||||
animate: true
|
animate: true
|
||||||
text: Weather.icon || "cloud_alert"
|
text: Weather.icon || "cloud_alert"
|
||||||
color: Colours.palette.m3secondary
|
color: Colours.palette.m3secondary
|
||||||
|
|
@ -31,8 +19,6 @@ RowLayout {
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
Layout.topMargin: Config.lock.sizes.border / 4
|
|
||||||
Layout.rightMargin: Config.lock.sizes.border / 2
|
|
||||||
|
|
||||||
spacing: Appearance.spacing.small
|
spacing: Appearance.spacing.small
|
||||||
|
|
||||||
|
|
@ -49,7 +35,6 @@ RowLayout {
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.maximumWidth: Config.lock.sizes.weatherWidth - icon.implicitWidth
|
|
||||||
|
|
||||||
animate: true
|
animate: true
|
||||||
text: Weather.description || qsTr("No weather")
|
text: Weather.description || qsTr("No weather")
|
||||||
|
|
@ -58,4 +43,12 @@ RowLayout {
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
running: true
|
||||||
|
triggeredOnStart: true
|
||||||
|
repeat: true
|
||||||
|
interval: 900000 // 15 minutes
|
||||||
|
onTriggered: Weather.reload()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue