Added a new QML file for UserConfiguration and also the initial
implementation for a CalendarGrid
This commit is contained in:
@@ -30,6 +30,13 @@ Rectangle
|
|||||||
width: 50
|
width: 50
|
||||||
height: parent.height - 4
|
height: parent.height - 4
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
||||||
|
onClicked: userConfiguration.open()
|
||||||
|
}
|
||||||
|
|
||||||
|
UserConfiguration
|
||||||
|
{
|
||||||
|
id: userConfiguration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ qt_add_qml_module(appProject-Orion
|
|||||||
QML_FILES CustomButton.qml
|
QML_FILES CustomButton.qml
|
||||||
QML_FILES Appheader.qml
|
QML_FILES Appheader.qml
|
||||||
RESOURCES resources.qrc
|
RESOURCES resources.qrc
|
||||||
|
QML_FILES CalendarGrid.qml
|
||||||
|
QML_FILES UserConfiguration.qml
|
||||||
)
|
)
|
||||||
|
|
||||||
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
|
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
|
||||||
|
|||||||
48
src/Project-Orion/CalendarGrid.qml
Normal file
48
src/Project-Orion/CalendarGrid.qml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Controls
|
||||||
|
|
||||||
|
GridLayout {
|
||||||
|
columns: 2
|
||||||
|
|
||||||
|
DayOfWeekRow {
|
||||||
|
locale: grid.locale
|
||||||
|
|
||||||
|
Layout.column: 1
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
WeekNumberColumn {
|
||||||
|
month: grid.month
|
||||||
|
year: grid.year
|
||||||
|
locale: grid.locale
|
||||||
|
Layout.fillHeight: true
|
||||||
|
delegate: Text {
|
||||||
|
text: weekNumber
|
||||||
|
font: control.font
|
||||||
|
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
|
||||||
|
opacity: model.month === monthGrid.month ? 1 : 0
|
||||||
|
text: monthGrid.locale.toString(model.date, "d")
|
||||||
|
font: monthGrid.font
|
||||||
|
|
||||||
|
required property var model
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
44
src/Project-Orion/UserConfiguration.qml
Normal file
44
src/Project-Orion/UserConfiguration.qml
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
|
||||||
|
Dialog {
|
||||||
|
id: dialog
|
||||||
|
modal: true
|
||||||
|
title: "Configure a new user"
|
||||||
|
width: 600
|
||||||
|
height: 400
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: usernameRow
|
||||||
|
spacing: 100
|
||||||
|
|
||||||
|
Label {
|
||||||
|
id: nameFieldLabel
|
||||||
|
text: qsTr("Username:")
|
||||||
|
}
|
||||||
|
|
||||||
|
TextField {
|
||||||
|
id: nameField
|
||||||
|
color: myPalette.text
|
||||||
|
width: 400
|
||||||
|
placeholderText: "Enter the new user's username"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: dateOfBirthRow
|
||||||
|
anchors.top: usernameRow.bottom
|
||||||
|
spacing: 100
|
||||||
|
|
||||||
|
Label {
|
||||||
|
id: dateOfBirthLabel
|
||||||
|
text: qsTr("Date of birth:")
|
||||||
|
}
|
||||||
|
|
||||||
|
CalendarGrid {
|
||||||
|
id: dateOfBirthGrid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
standardButtons: Dialog.Ok | Dialog.Cancel
|
||||||
|
}
|
||||||
@@ -3,4 +3,5 @@
|
|||||||
<file>user.svg</file>
|
<file>user.svg</file>
|
||||||
<file>tick.svg</file>
|
<file>tick.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
|
<qresource prefix="/"/>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
Reference in New Issue
Block a user