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>
This commit is contained in:
parent
9743a2e9b8
commit
3e3e98b340
3 changed files with 32 additions and 0 deletions
|
|
@ -2,4 +2,9 @@ import Quickshell.Io
|
||||||
|
|
||||||
JsonObject {
|
JsonObject {
|
||||||
property bool enabled: true
|
property bool enabled: true
|
||||||
|
property DesktopClock desktopClock: DesktopClock {}
|
||||||
|
|
||||||
|
component DesktopClock: JsonObject {
|
||||||
|
property bool enabled: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,13 @@ LazyLoader {
|
||||||
anchors.right: true
|
anchors.right: true
|
||||||
|
|
||||||
Wallpaper {}
|
Wallpaper {}
|
||||||
|
|
||||||
|
DesktopClock {
|
||||||
|
visible: Config.background.desktopClock.enabled
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.margins: Appearance.padding.large
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
20
widgets/DesktopClock.qml
Normal file
20
widgets/DesktopClock.qml
Normal file
|
|
@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue