From d40df98aa585894b9ce246119301d5c54c465c08 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 27 Nov 2025 08:14:15 +0100 Subject: [PATCH] =?UTF-8?q?waffles:=20make=20calendar=20more=20?= =?UTF-8?q?=F0=9F=8D=94=F0=9F=A6=85-friendly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit do we care about somalia and ethiopia --- dots/.config/quickshell/ii/modules/common/Config.qml | 6 +++++- .../quickshell/ii/modules/common/widgets/CalendarView.qml | 7 ++++++- .../modules/waffle/notificationCenter/CalendarWidget.qml | 7 ++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/common/Config.qml b/dots/.config/quickshell/ii/modules/common/Config.qml index 610a4959d..e5285d416 100644 --- a/dots/.config/quickshell/ii/modules/common/Config.qml +++ b/dots/.config/quickshell/ii/modules/common/Config.qml @@ -282,6 +282,10 @@ Singleton { property int suspend: 3 } + property JsonObject calendar: JsonObject { + property bool forceMondayWeekStart: true + } + property JsonObject cheatsheet: JsonObject { // Use a nerdfont to see the icons // 0: 󰖳 | 1: 󰌽 | 2: 󰘳 | 3:  | 4: 󰨡 @@ -581,7 +585,7 @@ Singleton { } property JsonObject waffles: JsonObject { - // Animations on Windoes are kinda janky. Setting the following to + // Some spots are kinda janky/awkward. Setting the following to // false will make (some) stuff also be like that for accuracy. // Example: the right-click menu of the Start button property JsonObject tweaks: JsonObject { diff --git a/dots/.config/quickshell/ii/modules/common/widgets/CalendarView.qml b/dots/.config/quickshell/ii/modules/common/widgets/CalendarView.qml index 56997ecba..44d64efd5 100644 --- a/dots/.config/quickshell/ii/modules/common/widgets/CalendarView.qml +++ b/dots/.config/quickshell/ii/modules/common/widgets/CalendarView.qml @@ -1,4 +1,5 @@ pragma ComponentBehavior: Bound +import QtQml import QtQuick import QtQuick.Controls import QtQuick.Layouts @@ -21,7 +22,8 @@ Item { // Configuration property int paddingWeeks: 2 // 1 should be sufficient with proper clipping and no padding - property bool american: false // 🍔🦅 = Sunday first + property var locale: Qt.locale() // Should be of type Locale but QML is being funny + property bool american: locale.firstDayOfWeek == Locale.Sunday // Scrolling function scrollMonthsAndSnap(x) { // Scroll x months and snap to month @@ -104,10 +106,13 @@ Item { } spacing: root.buttonSpacing + Repeater { model: root.totalWeeks + WeekRow { required property int index + sundayFirst: root.american date: new Date(root.dateInFirstWeek.getTime() + (index * root.millisPerWeek)) Layout.fillWidth: true spacing: root.buttonSpacing diff --git a/dots/.config/quickshell/ii/modules/waffle/notificationCenter/CalendarWidget.qml b/dots/.config/quickshell/ii/modules/waffle/notificationCenter/CalendarWidget.qml index 23fc7c6eb..5b595de31 100644 --- a/dots/.config/quickshell/ii/modules/waffle/notificationCenter/CalendarWidget.qml +++ b/dots/.config/quickshell/ii/modules/waffle/notificationCenter/CalendarWidget.qml @@ -1,4 +1,5 @@ pragma ComponentBehavior: Bound +import QtQml import QtQuick import QtQuick.Controls import QtQuick.Layouts @@ -16,6 +17,9 @@ BodyRectangle { // State property bool collapsed + // Locale + property var locale: Config.options.calendar.forceMondayWeekStart ? Qt.locale("en-GB") : Qt.locale() + implicitHeight: collapsed ? 0 : contentColumn.implicitHeight implicitWidth: contentColumn.implicitWidth @@ -38,7 +42,7 @@ BodyRectangle { spacing: 1 DayOfWeekRow { Layout.fillWidth: true - locale: Qt.locale("en-GB") + locale: root.locale spacing: calendarView.buttonSpacing implicitHeight: calendarView.buttonSize delegate: Item { @@ -56,6 +60,7 @@ BodyRectangle { } CalendarView { id: calendarView + locale: root.locale verticalPadding: 2 buttonSize: 41 // ??? buttonSpacing: 1