Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Kalendar
Commits
cb8395d4
Commit
cb8395d4
authored
Dec 03, 2021
by
Claudio Cambra
Browse files
Date picker improvements
parent
805afd9e
Pipeline
#105031
passed with stage
in 6 minutes and 41 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/contents/ui/DateChanger.qml
View file @
cb8395d4
...
...
@@ -21,6 +21,7 @@ QQC2.Popup {
property
bool
showDays
:
true
implicitWidth
:
Kirigami
.
Units
.
gridUnit
*
20
padding
:
0
contentItem
:
DatePicker
{
id
:
datePicker
...
...
src/contents/ui/DateCombo.qml
View file @
cb8395d4
...
...
@@ -44,10 +44,10 @@ QQC2.ComboBox {
height
:
Kirigami
.
Units
.
gridUnit
*
18
y
:
parent
.
y
+
parent
.
height
z
:
1000
padding
:
0
DatePicker
{
contentItem
:
DatePicker
{
id
:
datePicker
anchors.fill
:
parent
clickedDate
:
root
.
dateTime
selectedDate
:
root
.
dateTime
...
...
src/contents/ui/DatePicker.qml
View file @
cb8395d4
...
...
@@ -7,7 +7,7 @@ import QtQuick.Layouts 1.15
import
org
.
kde
.
kirigami
2.15
as
Kirigami
import
org
.
kde
.
kalendar
1.0
as
Kalendar
Item
{
QQC2.Control
{
id
:
datepicker
signal
datePicked
(
date
pickedDate
)
...
...
@@ -19,6 +19,12 @@ Item {
property
int
month
:
selectedDate
.
getMonth
()
property
int
day
:
selectedDate
.
getDate
()
property
bool
showDays
:
true
property
bool
showControlHeader
:
true
topPadding
:
Kirigami
.
Units
.
largeSpacing
+
Kirigami
.
Units
.
smallSpacing
rightPadding
:
Kirigami
.
Units
.
largeSpacing
+
Kirigami
.
Units
.
smallSpacing
bottomPadding
:
Kirigami
.
Units
.
largeSpacing
+
Kirigami
.
Units
.
smallSpacing
leftPadding
:
Kirigami
.
Units
.
largeSpacing
+
Kirigami
.
Units
.
smallSpacing
onSelectedDateChanged
:
setToDate
(
selectedDate
)
onShowDaysChanged
:
if
(
!
showDays
)
pickerView
.
currentIndex
=
1
;
...
...
@@ -118,15 +124,13 @@ Item {
selectedDate
=
new
Date
(
selectedDate
.
getFullYear
()
+
10
,
selectedDate
.
getMonth
(),
selectedDate
.
getDate
())
}
Layout.fillWidth
:
true
Layout.fillHeight
:
true
ColumnLayout
{
anchors.fill
:
parent
contentItem
:
ColumnLayout
{
id
:
pickerLayout
RowLayout
{
id
:
headingRow
Layout.fillWidth
:
true
visible
:
datepicker
.
showControlHeader
Kirigami.Heading
{
id
:
monthLabel
...
...
@@ -190,6 +194,10 @@ Item {
onClicked
:
pickerView
.
currentIndex
=
2
}
}
Kirigami.Separator
{
Layout.topMargin
:
(
-
pickerLayout
.
spacing
*
2
)
-
1
Layout.fillWidth
:
true
}
QQC2.SwipeView
{
id
:
pickerView
...
...
@@ -476,8 +484,6 @@ Item {
datepicker
.
datePicked
(
date
);
pickerView
.
currentIndex
=
1
;
}
}
}
}
...
...
@@ -486,6 +492,3 @@ Item {
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment