mirror of
https://github.com/danbulant/dots-hyprland
synced 2026-05-24 12:22:09 +00:00
config option for time format
This commit is contained in:
parent
1e24608e2b
commit
bef0739471
3 changed files with 10 additions and 6 deletions
|
|
@ -103,6 +103,12 @@ Singleton {
|
|||
}
|
||||
}
|
||||
|
||||
property QtObject time: QtObject {
|
||||
// https://doc.qt.io/qt-6/qtime.html#toString
|
||||
property string format: "hh:mm"
|
||||
property string dateFormat: "dddd, dd/MM"
|
||||
}
|
||||
|
||||
property QtObject hacks: QtObject {
|
||||
property int arbitraryRaceConditionDelay: 20 // milliseconds
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ Rectangle {
|
|||
property int remainingTasks: Todo.list.filter(task => !task.done).length;
|
||||
Layout.margins: 10
|
||||
Layout.leftMargin: 0
|
||||
text: `${DateTime.day} ${DateTime.month} ${DateTime.year} • ${remainingTasks} task${remainingTasks > 1 ? "s" : ""}`
|
||||
text: `${DateTime.collapsedCalendarFormat} • ${remainingTasks} task${remainingTasks > 1 ? "s" : ""}`
|
||||
font.pixelSize: Appearance.font.pixelSize.large
|
||||
color: Appearance.colors.colOnLayer1
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,11 +9,9 @@ pragma ComponentBehavior: Bound
|
|||
* A nice wrapper for date and time strings.
|
||||
*/
|
||||
Singleton {
|
||||
property string time: Qt.formatDateTime(clock.date, "hh:mm")
|
||||
property string date: Qt.formatDateTime(clock.date, "dddd, dd/MM")
|
||||
property string day: Qt.formatDateTime(clock.date, "dd")
|
||||
property string month: Qt.formatDateTime(clock.date, "MMMM")
|
||||
property string year: Qt.formatDateTime(clock.date, "yyyy")
|
||||
property string time: Qt.formatDateTime(clock.date, ConfigOptions?.time.format ?? "hh:mm")
|
||||
property string date: Qt.formatDateTime(clock.date, ConfigOptions?.time.dateFormat ?? "dddd, dd/MM")
|
||||
property string collapsedCalendarFormat: Qt.formatDateTime(clock.date, "dd MMMM yyyy")
|
||||
property string uptime: "0h, 0m"
|
||||
|
||||
SystemClock {
|
||||
|
|
|
|||
Loading…
Reference in a new issue