calendar
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Components
|
||||
import qs.Config
|
||||
import qs.Helpers
|
||||
|
||||
RowLayout {
|
||||
spacing: 12
|
||||
|
||||
Rectangle {
|
||||
Layout.preferredWidth: 40
|
||||
Layout.preferredHeight: 40
|
||||
color: "transparent"
|
||||
radius: 1000
|
||||
|
||||
CustomText {
|
||||
text: "◀"
|
||||
font.pointSize: 12
|
||||
color: DynamicColors.palette.m3onSurface
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
|
||||
StateLayer {
|
||||
onClicked: {
|
||||
if (Calendar.displayMonth === 0) {
|
||||
Calendar.displayMonth = 11;
|
||||
Calendar.displayYear -= 1;
|
||||
} else {
|
||||
Calendar.displayMonth -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CustomText {
|
||||
text: new Date(Calendar.displayYear, Calendar.displayMonth, 1).toLocaleDateString(
|
||||
Qt.locale(),
|
||||
"MMMM yyyy"
|
||||
)
|
||||
font.weight: 600
|
||||
font.pointSize: 14
|
||||
color: DynamicColors.palette.m3onSurface
|
||||
Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.preferredWidth: 40
|
||||
Layout.preferredHeight: 40
|
||||
color: "transparent"
|
||||
radius: 1000
|
||||
|
||||
CustomText {
|
||||
text: "▶"
|
||||
font.pointSize: 12
|
||||
color: DynamicColors.palette.m3onSurface
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
|
||||
StateLayer {
|
||||
onClicked: {
|
||||
if (Calendar.displayMonth === 11) {
|
||||
Calendar.displayMonth = 0;
|
||||
Calendar.displayYear += 1;
|
||||
} else {
|
||||
Calendar.displayMonth += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user