forked from Shinonome/dots-hyprland
waffles: make calendar more 🍔🦅-friendly
do we care about somalia and ethiopia
This commit is contained in:
@@ -282,6 +282,10 @@ Singleton {
|
|||||||
property int suspend: 3
|
property int suspend: 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property JsonObject calendar: JsonObject {
|
||||||
|
property bool forceMondayWeekStart: true
|
||||||
|
}
|
||||||
|
|
||||||
property JsonObject cheatsheet: JsonObject {
|
property JsonObject cheatsheet: JsonObject {
|
||||||
// Use a nerdfont to see the icons
|
// Use a nerdfont to see the icons
|
||||||
// 0: | 1: | 2: | 3: | 4:
|
// 0: | 1: | 2: | 3: | 4:
|
||||||
@@ -581,7 +585,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
property JsonObject waffles: JsonObject {
|
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.
|
// false will make (some) stuff also be like that for accuracy.
|
||||||
// Example: the right-click menu of the Start button
|
// Example: the right-click menu of the Start button
|
||||||
property JsonObject tweaks: JsonObject {
|
property JsonObject tweaks: JsonObject {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
import QtQml
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
@@ -21,7 +22,8 @@ Item {
|
|||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
property int paddingWeeks: 2 // 1 should be sufficient with proper clipping and no padding
|
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
|
// Scrolling
|
||||||
function scrollMonthsAndSnap(x) { // Scroll x months and snap to month
|
function scrollMonthsAndSnap(x) { // Scroll x months and snap to month
|
||||||
@@ -104,10 +106,13 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
spacing: root.buttonSpacing
|
spacing: root.buttonSpacing
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: root.totalWeeks
|
model: root.totalWeeks
|
||||||
|
|
||||||
WeekRow {
|
WeekRow {
|
||||||
required property int index
|
required property int index
|
||||||
|
sundayFirst: root.american
|
||||||
date: new Date(root.dateInFirstWeek.getTime() + (index * root.millisPerWeek))
|
date: new Date(root.dateInFirstWeek.getTime() + (index * root.millisPerWeek))
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: root.buttonSpacing
|
spacing: root.buttonSpacing
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
import QtQml
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
@@ -16,6 +17,9 @@ BodyRectangle {
|
|||||||
// State
|
// State
|
||||||
property bool collapsed
|
property bool collapsed
|
||||||
|
|
||||||
|
// Locale
|
||||||
|
property var locale: Config.options.calendar.forceMondayWeekStart ? Qt.locale("en-GB") : Qt.locale()
|
||||||
|
|
||||||
implicitHeight: collapsed ? 0 : contentColumn.implicitHeight
|
implicitHeight: collapsed ? 0 : contentColumn.implicitHeight
|
||||||
implicitWidth: contentColumn.implicitWidth
|
implicitWidth: contentColumn.implicitWidth
|
||||||
|
|
||||||
@@ -38,7 +42,7 @@ BodyRectangle {
|
|||||||
spacing: 1
|
spacing: 1
|
||||||
DayOfWeekRow {
|
DayOfWeekRow {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
locale: Qt.locale("en-GB")
|
locale: root.locale
|
||||||
spacing: calendarView.buttonSpacing
|
spacing: calendarView.buttonSpacing
|
||||||
implicitHeight: calendarView.buttonSize
|
implicitHeight: calendarView.buttonSize
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
@@ -56,6 +60,7 @@ BodyRectangle {
|
|||||||
}
|
}
|
||||||
CalendarView {
|
CalendarView {
|
||||||
id: calendarView
|
id: calendarView
|
||||||
|
locale: root.locale
|
||||||
verticalPadding: 2
|
verticalPadding: 2
|
||||||
buttonSize: 41 // ???
|
buttonSize: 41 // ???
|
||||||
buttonSpacing: 1
|
buttonSpacing: 1
|
||||||
|
|||||||
Reference in New Issue
Block a user