Compare commits

...

4 Commits

Author SHA1 Message Date
1e3f7a988d Added a disabled color to month days which should not be visible in the
current calendar
2025-12-15 00:44:06 +02:00
76857eaeb8 Fixed a bug in which the text of the calendar did not appear 2025-11-16 17:58:53 +02:00
9f43833cb1 Added a new QML file for UserConfiguration and also the initial
implementation for a CalendarGrid
2025-11-16 17:26:00 +02:00
d5e742155f Added new resource files, changed the CMake configuration to always
rebuild the resources files and also added the first main window to the
interface
2025-08-30 18:27:49 +03:00
9 changed files with 304 additions and 4 deletions

View File

@@ -0,0 +1,42 @@
import QtQuick
import QtQuick.Controls
Rectangle
{
width: parent.width
height: 50
color: "black"
Button
{
id: setDefaultButton
icon.source: "qrc:/resources/tick.svg"
icon.width: 40
icon.height: 40
icon.color: "transparent"
width: 50
height: parent.height - 4
anchors.right: createNewUserButton.left
}
Button
{
id: createNewUserButton
icon.source: "qrc:/resources/user.svg"
icon.width: 40
icon.height: 40
icon.color: "transparent"
width: 50
height: parent.height - 4
anchors.right: parent.right
onClicked: userConfiguration.open()
}
UserConfiguration
{
id: userConfiguration
}
}

View File

@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.16)
project(Project-Orion VERSION 0.1 LANGUAGES CXX) project(Project-Orion VERSION 0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTORCC ON)
find_package(Qt6 REQUIRED COMPONENTS Quick) find_package(Qt6 REQUIRED COMPONENTS Quick)
@@ -21,7 +22,11 @@ qt_add_qml_module(appProject-Orion
SOURCES userlist.h userlist.cpp SOURCES userlist.h userlist.cpp
SOURCES serialization.h SOURCES serialization.h
SOURCES serialization.cpp SOURCES serialization.cpp
QML_FILES Button.qml QML_FILES CustomButton.qml
QML_FILES Appheader.qml
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.

View File

@@ -0,0 +1,55 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQml
Flickable {
id: flickable
width: 200
height: 200
onDragStarted: console.info("Drag has started")
onDragEnded: console.info("Drag has ended")
GridLayout {
columns: 1
DayOfWeekRow {
locale: grid.locale
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
}

View File

@@ -1,4 +1,5 @@
import QtQuick import QtQuick
import QtQuick.Layouts
Window { Window {
width: 640 width: 640
@@ -8,12 +9,42 @@ Window {
minimumWidth: 200 minimumWidth: 200
minimumHeight: 150 minimumHeight: 150
SystemPalette { id: myPalette; colorGroup: SystemPalette.Active } SystemPalette
{
id: myPalette;
colorGroup: SystemPalette.Active
}
SystemPalette
{
id: disabledPalette;
colorGroup: SystemPalette.Disabled
}
color: myPalette.window color: myPalette.window
id: name
Button Appheader
{ {
text: "For testing purposes" id: myHeader
}
GridLayout {
id: grid
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.top: myHeader.bottom
anchors.leftMargin: 10
columns: 10
Repeater {
model: 30
Rectangle {
width: 30; height: 30
radius: 50
border.width: 1
color: "green"
}
}
} }
} }

View File

@@ -0,0 +1,48 @@
import QtQuick
import QtQuick.Controls
Dialog {
id: userDialog
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
currentDate: dateOfBirth
}
}
property date dateOfBirth: new Date()
property date dateOfDeath: new Date()
standardButtons: Dialog.Ok | Dialog.Cancel
}

View File

@@ -0,0 +1,7 @@
<RCC>
<qresource prefix="/resources">
<file>user.svg</file>
<file>tick.svg</file>
</qresource>
<qresource prefix="/"/>
</RCC>

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="392.23944"
height="352.99045"
viewBox="0 0 392.23944 352.99045"
version="1.1"
id="svg1"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="px">
<inkscape:page
x="0"
y="0"
width="392.23944"
height="352.99045"
id="page2"
margin="0"
bleed="0" />
</sodipodi:namedview>
<defs
id="defs1" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-79.920158,-79.249199)">
<path
style="fill:#15ff00;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 80.40236,163.66999 153.77586,431.26747 471.43996,106.69762 442.09056,79.937873 166.79688,350.99382 Z"
id="path1"
sodipodi:nodetypes="cccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="125.8321mm"
height="92.671555mm"
viewBox="0 0 125.8321 92.671555"
version="1.1"
id="svg1"
sodipodi:docname="user.svg"
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="1.7044739"
inkscape:cx="237.90332"
inkscape:cy="175.12735"
inkscape:window-width="1440"
inkscape:window-height="832"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1">
<inkscape:page
x="-4.7078728e-14"
y="0"
width="125.83211"
height="92.671555"
id="page2"
margin="0"
bleed="0" />
</sodipodi:namedview>
<defs
id="defs1" />
<path
id="path2"
style="fill:#000000;stroke-width:2.47253"
d="M 58.57937,60.880724 A 70.353088,70.353088 0 0 0 2.4080776e-6,92.272604 H 117.15926 A 70.353088,70.353088 0 0 0 58.57937,60.880724 Z" />
<path
id="path3"
style="fill:#000000;stroke-width:2.47253"
d="m 115.06636,16.559916 a 10.765774,63.092445 0 0 0 -10.76575,63.092278 10.765774,63.092445 0 0 0 0.23151,13.01936 h 21.06797 a 10.765774,63.092445 0 0 0 0.23202,-13.01936 10.765774,63.092445 0 0 0 -10.76575,-63.092278 z" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-46.42042,-54.043526)">
<circle
style="fill:#000000;stroke-width:2.47253"
id="path1"
cx="105"
cy="82.255211"
r="25.036684" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB