move anchors to Loader, remove unnecessary visible and move setting

This commit is contained in:
hoovad
2025-08-27 06:04:13 +02:00
parent 2b54f64c8c
commit 1062ef9b49
2 changed files with 24 additions and 26 deletions
@@ -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
@@ -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;
}
}
}
}