diff options
| -rw-r--r-- | bar/Bar.qml | 6 | ||||
| -rw-r--r-- | bar/TimeDate.qml | 27 | ||||
| -rw-r--r-- | services/TimeDate.qml | 15 |
3 files changed, 47 insertions, 1 deletions
diff --git a/bar/Bar.qml b/bar/Bar.qml index 31d9c78..df4c081 100644 --- a/bar/Bar.qml +++ b/bar/Bar.qml @@ -1,7 +1,7 @@ import QtQuick import Quickshell import QtQuick.Layouts -import qs.utils +import qs.components import qs.config Scope { @@ -76,6 +76,10 @@ Scope { implicitWidth: (child.width - centerRow.width) / 2 implicitHeight: child.height + TimeDate { + Layout.fillHeight: true + Layout.fillWidth: true + } Network { Layout.fillHeight: true Layout.fillWidth: true diff --git a/bar/TimeDate.qml b/bar/TimeDate.qml new file mode 100644 index 0000000..93da141 --- /dev/null +++ b/bar/TimeDate.qml @@ -0,0 +1,27 @@ +import QtQuick +import QtQuick.Layouts + +import qs.services as Services +import qs.utils +import qs.config as Config + +Item { + id: root + RowLayout { + Item { + Layout.fillWidth: true + } + anchors.fill: parent + spacing: Config.Bar.resourceIconTextSpacing + + Icons { + text: Config.Icons.resource.clock + } + Text { + text: Services.TimeDate.time + } + Item { + Layout.fillWidth: true + } + } +} diff --git a/services/TimeDate.qml b/services/TimeDate.qml new file mode 100644 index 0000000..ff9343b --- /dev/null +++ b/services/TimeDate.qml @@ -0,0 +1,15 @@ +pragma Singleton + +import Quickshell +import QtQuick + +Singleton { + id: root + readonly property string time: Qt.formatDateTime(clock.date, "hh:mm:ss") + readonly property string date: Qt.formatDateTime(clock.date, "dddd dd/MM") + + SystemClock { + id: clock + precision: SystemClock.Seconds + } +} |
