-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalendar.kvo
More file actions
88 lines (80 loc) · 2.16 KB
/
Copy pathCalendar.kvo
File metadata and controls
88 lines (80 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
widget {
meta {
name: "Calendar"
id: "calendar"
}
onRender() {
import QtQuick
import qs.ui.controls.primitives
import QtQuick.Layouts
import QtQuick.Controls
import qs.ui.controls.providers
import qs.ui.controls.auxiliary.widget
import qs.config
import qs
WidgetItem {
id: root
ColumnLayout {
anchors.fill: parent
anchors.margins: 15
spacing: 4
CFText {
id: month
text: Qt.locale(Config.general.language).toString(new Date(), "MMMM")
font.pixelSize: root.textSize
font.weight: 600
font.capitalization: Font.AllUppercase
color: Config.appearance.multiAccentColor ? '#ff3838' : AccentColor.color
height: 10
}
DayOfWeekRow {
id: row
locale: grid.locale
Layout.column: 1
Layout.fillWidth: true
delegate: CFText {
text: narrowName
font.weight: 500
font.pixelSize: root.textSize
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
required property string narrowName
}
}
MonthGrid {
id: grid
locale: Qt.locale(Config.general.language)
Layout.fillWidth: true
Layout.fillHeight: true
Layout.bottomMargin: -root.textSize + 10
delegate: Item {
required property var model
CFRect {
anchors {
fill: parent
margins: -4
}
radius: 99
color: model.today ? (Config.appearance.multiAccentColor ? '#ff3838' : AccentColor.color) : "transparent"
}
CFText {
id: textCell
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.pixelSize: root.textSize
height: parent.height
width: parent.width
colorLightMode: model.today ? (Config.appearance.multiAccentColor ? "white" : AccentColor.textColor) : "#1e1e1e"
colorDarkMode: model.today ? (Config.appearance.multiAccentColor ? "white" : AccentColor.textColor) : "#fff"
visible: model.month === grid.month
text: grid.locale.toString(model.date, "d")
}
}
}
}
}
}
onPlacement(data) {
data.allow()
}
}