diff --git a/.config/quickshell/ii/modules/common/Config.qml b/.config/quickshell/ii/modules/common/Config.qml index abcaaf80f..464fe9c4a 100644 --- a/.config/quickshell/ii/modules/common/Config.qml +++ b/.config/quickshell/ii/modules/common/Config.qml @@ -280,6 +280,7 @@ Singleton { property JsonObject time: JsonObject { // https://doc.qt.io/qt-6/qtime.html#toString property string format: "hh:mm" + property string shortDateFormat: "dd/MM" property string dateFormat: "ddd, dd/MM" property JsonObject pomodoro: JsonObject { property string alertSound: "" diff --git a/.config/quickshell/ii/modules/verticalBar/VerticalBarContent.qml b/.config/quickshell/ii/modules/verticalBar/VerticalBarContent.qml index 6d80da84a..7d72eed29 100644 --- a/.config/quickshell/ii/modules/verticalBar/VerticalBarContent.qml +++ b/.config/quickshell/ii/modules/verticalBar/VerticalBarContent.qml @@ -153,6 +153,9 @@ Item { // Bar content region Layout.fillWidth: true Layout.fillHeight: false } + + HorizontalBarSeparator {} + VerticalMedia { Layout.fillWidth: true Layout.fillHeight: false @@ -198,11 +201,25 @@ Item { // Bar content region Layout.fillHeight: false } + HorizontalBarSeparator {} + + VerticalDateWidget { + Layout.fillWidth: true + Layout.fillHeight: false + } + + HorizontalBarSeparator { + visible: UPower.displayDevice.isLaptopBattery + } + BatteryIndicator { visible: UPower.displayDevice.isLaptopBattery Layout.fillWidth: true Layout.fillHeight: false } + + + } } diff --git a/.config/quickshell/ii/modules/verticalBar/VerticalDateWidget.qml b/.config/quickshell/ii/modules/verticalBar/VerticalDateWidget.qml new file mode 100644 index 000000000..8ff9386c3 --- /dev/null +++ b/.config/quickshell/ii/modules/verticalBar/VerticalDateWidget.qml @@ -0,0 +1,64 @@ +import qs.modules.common +import qs.modules.common.widgets +import qs.services +import QtQuick +import QtQuick.Shapes +import QtQuick.Layouts +import "../bar" as Bar + +Item { // Full hitbox + id: root + + implicitHeight: content.implicitHeight + implicitWidth: Appearance.sizes.verticalBarWidth + property var dayOfMonth: DateTime.shortDate.split(/[-\/]/)[0] // What if 🍔murica🦅? good question + property var monthOfYear: DateTime.shortDate.split(/[-\/]/)[1] + + Item { // Boundaries for date numbers + id: content + anchors.centerIn: parent + implicitWidth: 24 + implicitHeight: 30 + + Shape { + id: diagonalLine + property real padding: 4 + anchors.fill: parent + preferredRendererType: Shape.CurveRenderer + + ShapePath { + strokeWidth: 1.2 + strokeColor: Appearance.colors.colSubtext + fillColor: "transparent" + startX: content.width - diagonalLine.padding + startY: diagonalLine.padding + PathLine { + x: diagonalLine.padding + y: content.height - diagonalLine.padding + } + } + } + + StyledText { + id: dayText + anchors { + top: parent.top + left: parent.left + } + font.pixelSize: 13 + color: Appearance.colors.colOnLayer1 + text: dayOfMonth + } + + StyledText { + id: monthText + anchors { + bottom: parent.bottom + right: parent.right + } + font.pixelSize: 13 + color: Appearance.colors.colOnLayer1 + text: monthOfYear + } + } +} diff --git a/.config/quickshell/ii/services/DateTime.qml b/.config/quickshell/ii/services/DateTime.qml index 16dc6c4e6..8a185e0bd 100644 --- a/.config/quickshell/ii/services/DateTime.qml +++ b/.config/quickshell/ii/services/DateTime.qml @@ -14,6 +14,7 @@ Singleton { precision: SystemClock.Minutes } property string time: Qt.locale().toString(clock.date, Config.options?.time.format ?? "hh:mm") + property string shortDate: Qt.locale().toString(clock.date, Config.options?.time.shortDateFormat ?? "dd/MM") property string date: Qt.locale().toString(clock.date, Config.options?.time.dateFormat ?? "dddd, dd/MM") property string collapsedCalendarFormat: Qt.locale().toString(clock.date, "dd MMMM yyyy") property string uptime: "0h, 0m"