diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-22 23:58:39 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-22 23:58:39 +1000 |
| commit | da1d96f5e8df96a66c0897f103d3824efa0e26c5 (patch) | |
| tree | c24da4213be5347eb0c214ea5fc5b6ef7cd0aa70 /modules/lock/Backgrounds.qml | |
| parent | lock: static border (diff) | |
| download | caelestia-shell-da1d96f5e8df96a66c0897f103d3824efa0e26c5.tar.gz caelestia-shell-da1d96f5e8df96a66c0897f103d3824efa0e26c5.tar.bz2 caelestia-shell-da1d96f5e8df96a66c0897f103d3824efa0e26c5.zip | |
lock: add weather
Diffstat (limited to 'modules/lock/Backgrounds.qml')
| -rw-r--r-- | modules/lock/Backgrounds.qml | 79 |
1 files changed, 69 insertions, 10 deletions
diff --git a/modules/lock/Backgrounds.qml b/modules/lock/Backgrounds.qml index 15836b5..3bcedd6 100644 --- a/modules/lock/Backgrounds.qml +++ b/modules/lock/Backgrounds.qml @@ -9,9 +9,12 @@ Item { id: root required property bool locked + required property real weatherWidth readonly property real clockBottom: innerMask.anchors.margins + clockPath.height readonly property real inputTop: innerMask.anchors.margins + inputPath.height + readonly property real weatherTop: innerMask.anchors.margins + weatherPath.height + readonly property real weatherRight: innerMask.anchors.margins + weatherPath.width anchors.fill: parent @@ -34,21 +37,12 @@ Item { id: innerMask anchors.fill: parent - anchors.margins: root.locked ? Config.lock.sizes.border : 0 - + anchors.margins: root.locked ? Config.lock.sizes.border : -radius / 2 radius: Appearance.rounding.large * 2 Behavior on anchors.margins { Anim {} } - - Behavior on anchors.leftMargin { - Anim {} - } - - Behavior on anchors.rightMargin { - Anim {} - } } } @@ -202,6 +196,71 @@ Item { } } } + + ShapePath { + id: weatherPath + + property int width: root.locked ? root.weatherWidth - Config.lock.sizes.border / 4 : 0 + property real height: root.locked ? Config.lock.sizes.weatherHeight : 0 + + readonly property real rounding: Appearance.rounding.large * 2 + readonly property real roundingX: width < rounding * 2 ? width / 2 : rounding + readonly property real roundingY: height < rounding * 2 ? height / 2 : rounding + + strokeWidth: -1 + fillColor: Config.border.colour + + startY: Math.ceil(innerMask.height) - height - roundingY + + PathArc { + relativeX: weatherPath.roundingX + relativeY: weatherPath.roundingY + radiusX: Math.min(weatherPath.rounding, weatherPath.width) + radiusY: Math.min(weatherPath.rounding, weatherPath.height) + direction: PathArc.Counterclockwise + } + PathLine { + relativeX: weatherPath.width - weatherPath.roundingX * 2 + relativeY: 0 + } + PathArc { + relativeX: weatherPath.roundingX + relativeY: weatherPath.roundingY + radiusX: Math.min(weatherPath.rounding, weatherPath.width) + radiusY: Math.min(weatherPath.rounding, weatherPath.height) + } + PathLine { + relativeX: 0 + relativeY: weatherPath.height - weatherPath.roundingY * 2 + } + PathArc { + relativeX: weatherPath.roundingX + relativeY: weatherPath.roundingY + radiusX: Math.min(weatherPath.rounding, weatherPath.width) + radiusY: Math.min(weatherPath.rounding, weatherPath.height) + direction: PathArc.Counterclockwise + } + PathLine { + relativeX: -weatherPath.width - weatherPath.roundingX + relativeY: 0 + } + + Behavior on width { + Anim {} + } + + Behavior on height { + Anim {} + } + + Behavior on fillColor { + ColorAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard + } + } + } } component Anim: NumberAnimation { |