diff --git a/src/Project-Orion/CalendarGrid.qml b/src/Project-Orion/CalendarGrid.qml index 6ebfe67..9c31038 100644 --- a/src/Project-Orion/CalendarGrid.qml +++ b/src/Project-Orion/CalendarGrid.qml @@ -1,45 +1,55 @@ import QtQuick import QtQuick.Layouts import QtQuick.Controls +import QtQml -GridLayout { - columns: 2 +Flickable { + id: flickable + width: 200 + height: 200 + onDragStarted: console.info("Drag has started") + onDragEnded: console.info("Drag has ended") - DayOfWeekRow { - locale: grid.locale + GridLayout { + columns: 1 - Layout.column: 1 - Layout.fillWidth: true - } + DayOfWeekRow { + locale: grid.locale - 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 - year: 2025 - locale: Qt.locale("en_US") - - Layout.fillWidth: true - Layout.fillHeight: true - delegate: Text { - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - text: model.day - color: myPalette.text - required property var model + + Layout.fillWidth: true + } + + // 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 + year: currentDate.getFullYear() + locale: Qt.locale("en_US") + + Layout.fillWidth: true + Layout.fillHeight: true + delegate: Text { + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + text: model.day + color: model.month === currentDate.getMonth() ? myPalette.text : disabledPalette.text + required property var model + } } } + required property date currentDate } diff --git a/src/Project-Orion/Main.qml b/src/Project-Orion/Main.qml index 5139aec..4de8b4f 100644 --- a/src/Project-Orion/Main.qml +++ b/src/Project-Orion/Main.qml @@ -9,7 +9,18 @@ Window { minimumWidth: 200 minimumHeight: 150 - SystemPalette { id: myPalette; colorGroup: SystemPalette.Active } + SystemPalette + { + id: myPalette; + colorGroup: SystemPalette.Active + } + + SystemPalette + { + id: disabledPalette; + colorGroup: SystemPalette.Disabled + } + color: myPalette.window id: name diff --git a/src/Project-Orion/UserConfiguration.qml b/src/Project-Orion/UserConfiguration.qml index 2f0ef8c..39013a9 100644 --- a/src/Project-Orion/UserConfiguration.qml +++ b/src/Project-Orion/UserConfiguration.qml @@ -2,7 +2,7 @@ import QtQuick import QtQuick.Controls Dialog { - id: dialog + id: userDialog modal: true title: "Configure a new user" width: 600 @@ -37,8 +37,12 @@ Dialog { CalendarGrid { id: dateOfBirthGrid + currentDate: dateOfBirth } } + property date dateOfBirth: new Date() + property date dateOfDeath: new Date() + standardButtons: Dialog.Ok | Dialog.Cancel }