From 1062ef9b49cf165d6ca6706283e895b618b84136 Mon Sep 17 00:00:00 2001 From: hoovad Date: Wed, 27 Aug 2025 06:04:13 +0200 Subject: [PATCH] move anchors to Loader, remove unnecessary visible and move setting --- .../ii/modules/background/Background.qml | 26 +++++++++---------- .../ii/modules/settings/InterfaceConfig.qml | 24 ++++++++--------- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/.config/quickshell/ii/modules/background/Background.qml b/.config/quickshell/ii/modules/background/Background.qml index 8b3d01931..430621547 100644 --- a/.config/quickshell/ii/modules/background/Background.qml +++ b/.config/quickshell/ii/modules/background/Background.qml @@ -217,22 +217,20 @@ Variants { // The clock Loader { active: Config.options.background.showClock + anchors { + left: wallpaper.left + top: wallpaper.top + leftMargin: bgRoot.movableXSpace + ((root.fixedClockPosition ? root.fixedClockX : bgRoot.clockX * bgRoot.effectiveWallpaperScale) - implicitWidth / 2) + topMargin: bgRoot.movableYSpace + ((root.fixedClockPosition ? root.fixedClockY : bgRoot.clockY * bgRoot.effectiveWallpaperScale) - implicitHeight / 2) + Behavior on leftMargin { + animation: Appearance.animation.elementMove.numberAnimation.createObject(this) + } + Behavior on topMargin { + animation: Appearance.animation.elementMove.numberAnimation.createObject(this) + } + } sourceComponent: Item { id: clock - visible: Config.options.background.show_clock - anchors { - left: wallpaper.left - top: wallpaper.top - leftMargin: bgRoot.movableXSpace + ((root.fixedClockPosition ? root.fixedClockX : bgRoot.clockX * bgRoot.effectiveWallpaperScale) - implicitWidth / 2) - topMargin: bgRoot.movableYSpace + ((root.fixedClockPosition ? root.fixedClockY : bgRoot.clockY * bgRoot.effectiveWallpaperScale) - implicitHeight / 2) - Behavior on leftMargin { - animation: Appearance.animation.elementMove.numberAnimation.createObject(this) - } - Behavior on topMargin { - animation: Appearance.animation.elementMove.numberAnimation.createObject(this) - } - } - implicitWidth: clockColumn.implicitWidth implicitHeight: clockColumn.implicitHeight diff --git a/.config/quickshell/ii/modules/settings/InterfaceConfig.qml b/.config/quickshell/ii/modules/settings/InterfaceConfig.qml index 52d8f96eb..233d6dad9 100644 --- a/.config/quickshell/ii/modules/settings/InterfaceConfig.qml +++ b/.config/quickshell/ii/modules/settings/InterfaceConfig.qml @@ -69,6 +69,18 @@ ContentPage { } } + ContentSection { + title: Translation.tr("Background") + + ConfigSwitch { + text: Translation.tr("Show clock") + checked: Config.options.background.showClock + onCheckedChanged: { + Config.options.background.showClock = checked; + } + } + } + ContentSection { title: Translation.tr("Bar") @@ -624,16 +636,4 @@ ContentPage { } } } - - ContentSection { - title: Translation.tr("Background") - - ConfigSwitch { - text: Translation.tr("Show clock") - checked: Config.options.background.showClock - onCheckedChanged: { - Config.options.background.showClock = checked; - } - } - } }