From adc6dd35dd2570e6f96ca7c06e95eb4b0d89614f Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 11 Jan 2026 16:55:20 +0200 Subject: [PATCH] Passed down the palette configurations to the subcomponents through the creation stack --- src/Project-Orion/Appheader.qml | 5 +++++ src/Project-Orion/CalendarGrid.qml | 27 +++++++++---------------- src/Project-Orion/Main.qml | 2 ++ src/Project-Orion/UserConfiguration.qml | 7 ++++++- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/Project-Orion/Appheader.qml b/src/Project-Orion/Appheader.qml index c6b5ee4..68911a6 100644 --- a/src/Project-Orion/Appheader.qml +++ b/src/Project-Orion/Appheader.qml @@ -37,6 +37,11 @@ Rectangle UserConfiguration { id: userConfiguration + configActivePalette: headerPalette + configDisabledTextColor: headerDisabledPalette.text } + + required property SystemPalette headerPalette; + required property SystemPalette headerDisabledPalette; } diff --git a/src/Project-Orion/CalendarGrid.qml b/src/Project-Orion/CalendarGrid.qml index f6eeca7..d1adc9c 100644 --- a/src/Project-Orion/CalendarGrid.qml +++ b/src/Project-Orion/CalendarGrid.qml @@ -16,32 +16,19 @@ Flickable { Layout.fillWidth: true } - // We don't need a week column for the moment - // WeekNumberColumn { - // month: grid.month - // year: grid.year - // locale: grid.locale - // Layout.fillHeight: true - // delegate: Text { - // text: weekNumber - // horizontalAlignment: Text.AlignHCenter - // verticalAlignment: Text.AlignVCenter - // color: myPalette.text - // required property int weekNumber - // } - // } - MonthGrid { id: grid - month: Calendar.November + month: Calendar.January year: currentDate.getFullYear() locale: Qt.locale("en_US") Layout.fillWidth: true Layout.fillHeight: true delegate: Rectangle { - color: model.today ? "transparent": myPalette.accent + color: model.today ? activePalette.dark: activePalette.light + border.color: model.date === currentDate ? "green": "transparent" + border.width: 3 width: 30 height: 20 @@ -51,13 +38,17 @@ Flickable { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter text: model.day - color: model.month === currentDate.getMonth() ? myPalette.text : disabledPalette.text + color: model.month === currentDate.getMonth() ? activePalette.text : disabledTextColor } required property var model } + + property date currentlySelectedDate: currentDate; } } required property date currentDate + required property SystemPalette activePalette; + required property color disabledTextColor; } diff --git a/src/Project-Orion/Main.qml b/src/Project-Orion/Main.qml index 4de8b4f..05034c5 100644 --- a/src/Project-Orion/Main.qml +++ b/src/Project-Orion/Main.qml @@ -27,6 +27,8 @@ Window { Appheader { id: myHeader + headerPalette: myPalette + headerDisabledPalette: disabledPalette } GridLayout { diff --git a/src/Project-Orion/UserConfiguration.qml b/src/Project-Orion/UserConfiguration.qml index 39013a9..6f63af2 100644 --- a/src/Project-Orion/UserConfiguration.qml +++ b/src/Project-Orion/UserConfiguration.qml @@ -19,7 +19,7 @@ Dialog { TextField { id: nameField - color: myPalette.text + color: configActivePalette.text width: 400 placeholderText: "Enter the new user's username" } @@ -38,11 +38,16 @@ Dialog { CalendarGrid { id: dateOfBirthGrid currentDate: dateOfBirth + activePalette: configActivePalette; + disabledTextColor: configDisabledTextColor; } } property date dateOfBirth: new Date() property date dateOfDeath: new Date() + required property SystemPalette configActivePalette; + required property color configDisabledTextColor; + standardButtons: Dialog.Ok | Dialog.Cancel }