diff options
| author | Kaj <kajgiesbers@hotmail.com> | 2025-07-21 16:17:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-22 00:17:23 +1000 |
| commit | 3e3e98b340fc462cdc5ba4fb0f4ac09f94a68cd8 (patch) | |
| tree | d8c84d2d9110bdc7f3e38456136a1e6e24f39060 | |
| parent | icons: fix quoting issues (diff) | |
| download | caelestia-shell-3e3e98b340fc462cdc5ba4fb0f4ac09f94a68cd8.tar.gz caelestia-shell-3e3e98b340fc462cdc5ba4fb0f4ac09f94a68cd8.tar.bz2 caelestia-shell-3e3e98b340fc462cdc5ba4fb0f4ac09f94a68cd8.zip | |
feat: add a simple desktop clock (#238)
* Adds a simple desktop clock
* Adds ability to change color
* Sets the desktop clock to be disabled by default
* Improves desktop clock code based on feedback
* Disable the clock by default
* Fixes config of background clock
* Removes the timer for the desktop clock
---------
Co-authored-by: Kaj Giesbers <kajgiesbers@gmail.com>
| -rw-r--r-- | config/BackgroundConfig.qml | 5 | ||||
| -rw-r--r-- | modules/background/Background.qml | 7 | ||||
| -rw-r--r-- | widgets/DesktopClock.qml | 20 |
3 files changed, 32 insertions, 0 deletions
diff --git a/config/BackgroundConfig.qml b/config/BackgroundConfig.qml index 9bcca87..35e16d1 100644 --- a/config/BackgroundConfig.qml +++ b/config/BackgroundConfig.qml @@ -2,4 +2,9 @@ import Quickshell.Io JsonObject { property bool enabled: true + property DesktopClock desktopClock: DesktopClock {} + + component DesktopClock: JsonObject { + property bool enabled: false + } } diff --git a/modules/background/Background.qml b/modules/background/Background.qml index c744baa..1c18786 100644 --- a/modules/background/Background.qml +++ b/modules/background/Background.qml @@ -26,6 +26,13 @@ LazyLoader { anchors.right: true Wallpaper {} + + DesktopClock { + visible: Config.background.desktopClock.enabled + anchors.right: parent.right + anchors.bottom: parent.bottom + anchors.margins: Appearance.padding.large + } } } } diff --git a/widgets/DesktopClock.qml b/widgets/DesktopClock.qml new file mode 100644 index 0000000..30e4fc4 --- /dev/null +++ b/widgets/DesktopClock.qml @@ -0,0 +1,20 @@ +import QtQuick +import QtQuick.Controls +import qs.config +import qs.services +import qs.widgets + +Item { + id: clockRoot + width: timeText.implicitWidth + Appearance.padding.large * 2 + height: timeText.implicitHeight + Appearance.padding.large * 2 + + + StyledText { + id: timeText + anchors.centerIn: parent + font.pointSize: Appearance.font.size.extraLarge + font.bold: true + text: Time.format("hh:mm:ss"); + } +} |