quickshell media player enchantments
This commit is contained in:
18
quickshell/bar/widgets/clock/Clock.qml
Normal file
18
quickshell/bar/widgets/clock/Clock.qml
Normal file
@@ -0,0 +1,18 @@
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import QtQuick
|
||||
|
||||
import "../common" as Common
|
||||
|
||||
Item {
|
||||
id: root
|
||||
width: text.width
|
||||
height: text.height
|
||||
Common.Container {}
|
||||
Text {
|
||||
id: text
|
||||
text: ClockData.time
|
||||
font.pointSize: 10.25
|
||||
color: "white"
|
||||
}
|
||||
}
|
||||
22
quickshell/bar/widgets/clock/ClockData.qml
Normal file
22
quickshell/bar/widgets/clock/ClockData.qml
Normal file
@@ -0,0 +1,22 @@
|
||||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import QtQuick
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
readonly property string time: {
|
||||
// Qt.formatDateTime(clock.date, "ddd d MMM [hh:mm]")
|
||||
Qt.formatDateTime(clock.date, "hh:mm")
|
||||
}
|
||||
readonly property string date: {
|
||||
Qt.formatDateTime(clock.date, "d MMM")
|
||||
// Qt.formatDateTime(clock.date, "hh:mm")
|
||||
}
|
||||
|
||||
SystemClock {
|
||||
id: clock
|
||||
precision: SystemClock.Minutes
|
||||
}
|
||||
}
|
||||
19
quickshell/bar/widgets/clock/Date.qml
Normal file
19
quickshell/bar/widgets/clock/Date.qml
Normal file
@@ -0,0 +1,19 @@
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import QtQuick
|
||||
|
||||
import "../common" as Common
|
||||
|
||||
Item {
|
||||
id: root
|
||||
width: text.width + 15
|
||||
height: text.height
|
||||
Common.Container {}
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
id: text
|
||||
text: ClockData.date
|
||||
font.pointSize: 10.25
|
||||
color: "white"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user