add setting to show/hide the clock in background (#1881)

This commit is contained in:
end-4
2025-08-31 13:06:16 +07:00
committed by GitHub
3 changed files with 99 additions and 83 deletions
@@ -117,8 +117,8 @@ Variants {
function updateClockPosition() {
// Somehow all this manual setting is needed to make the proc correctly use the new values
leastBusyRegionProc.path = bgRoot.wallpaperPath
leastBusyRegionProc.contentWidth = clock.implicitWidth + root.clockSizePadding * 2
leastBusyRegionProc.contentHeight = clock.implicitHeight + root.clockSizePadding * 2
leastBusyRegionProc.contentWidth = clockLoader.implicitWidth + root.clockSizePadding * 2
leastBusyRegionProc.contentHeight = clockLoader.implicitHeight + root.clockSizePadding * 2
leastBusyRegionProc.horizontalPadding = bgRoot.movableXSpace + root.screenSizePadding * 2
leastBusyRegionProc.verticalPadding = bgRoot.movableYSpace + root.screenSizePadding * 2
leastBusyRegionProc.running = false;
@@ -215,8 +215,9 @@ Variants {
}
// The clock
Item {
id: clock
Loader {
id: clockLoader
active: Config.options.background.showClock
anchors {
left: wallpaper.left
top: wallpaper.top
@@ -229,7 +230,8 @@ Variants {
animation: Appearance.animation.elementMove.numberAnimation.createObject(this)
}
}
sourceComponent: Item {
id: clock
implicitWidth: clockColumn.implicitWidth
implicitHeight: clockColumn.implicitHeight
@@ -319,4 +321,5 @@ Variants {
}
}
}
}
}
@@ -119,6 +119,7 @@ Singleton {
property bool fixedClockPosition: false
property real clockX: -500
property real clockY: -500
property bool showClock: true
property string wallpaperPath: ""
property string thumbnailPath: ""
property JsonObject parallax: JsonObject {
@@ -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")