From 6616cb13272132302f0b58573e98b4564e105e12 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 22 Jul 2025 00:21:57 +1000 Subject: [PATCH] background: some fixes for desktop clock Loader + use implicit width/height + move --- modules/background/Background.qml | 9 +++++++-- {widgets => modules/background}/DesktopClock.qml | 16 +++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) rename {widgets => modules/background}/DesktopClock.qml (52%) diff --git a/modules/background/Background.qml b/modules/background/Background.qml index 1c18786c..a28f1dd4 100644 --- a/modules/background/Background.qml +++ b/modules/background/Background.qml @@ -2,6 +2,7 @@ import qs.widgets import qs.config import Quickshell import Quickshell.Wayland +import QtQuick LazyLoader { activeAsync: Config.background.enabled @@ -27,11 +28,15 @@ LazyLoader { Wallpaper {} - DesktopClock { - visible: Config.background.desktopClock.enabled + Loader { anchors.right: parent.right anchors.bottom: parent.bottom anchors.margins: Appearance.padding.large + + active: Config.background.desktopClock.enabled + asynchronous: true + + source: "DesktopClock.qml" } } } diff --git a/widgets/DesktopClock.qml b/modules/background/DesktopClock.qml similarity index 52% rename from widgets/DesktopClock.qml rename to modules/background/DesktopClock.qml index 30e4fc4a..380e65a9 100644 --- a/widgets/DesktopClock.qml +++ b/modules/background/DesktopClock.qml @@ -1,20 +1,18 @@ -import QtQuick -import QtQuick.Controls -import qs.config -import qs.services import qs.widgets +import qs.services +import qs.config +import QtQuick Item { - id: clockRoot - width: timeText.implicitWidth + Appearance.padding.large * 2 - height: timeText.implicitHeight + Appearance.padding.large * 2 - + implicitWidth: timeText.implicitWidth + Appearance.padding.large * 2 + implicitHeight: timeText.implicitHeight + Appearance.padding.large * 2 StyledText { id: timeText + anchors.centerIn: parent + text: Time.format("hh:mm:ss") font.pointSize: Appearance.font.size.extraLarge font.bold: true - text: Time.format("hh:mm:ss"); } }