2025-01-08 08:54:13 +00:00
|
|
|
pragma ComponentBehavior: Bound
|
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
|
|
|
Control {
|
|
|
|
id: control
|
|
|
|
|
|
|
|
property real dayWidth: 24
|
|
|
|
property alias fromDate: model.fromDate
|
|
|
|
property alias toDate: model.toDate
|
|
|
|
|
|
|
|
contentItem: Row {
|
|
|
|
Repeater {
|
|
|
|
model: model
|
|
|
|
|
|
|
|
delegate: Label {
|
2025-01-20 10:00:11 +00:00
|
|
|
id: delegate
|
|
|
|
|
2025-01-08 08:54:13 +00:00
|
|
|
required property string display
|
2025-01-20 10:00:11 +00:00
|
|
|
required property bool isWeekend
|
2025-01-08 08:54:13 +00:00
|
|
|
|
2025-01-15 14:22:35 +00:00
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.top: parent.top
|
|
|
|
font.bold: true
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
2025-01-08 08:54:13 +00:00
|
|
|
text: display
|
2025-01-15 14:22:35 +00:00
|
|
|
verticalAlignment: Text.AlignVCenter
|
2025-01-08 08:54:13 +00:00
|
|
|
width: control.dayWidth
|
|
|
|
|
2025-01-20 10:00:11 +00:00
|
|
|
background: Rectangle {
|
|
|
|
color: delegate.isWeekend ? delegate.palette.alternateBase : "transparent"
|
|
|
|
}
|
|
|
|
|
2025-01-15 14:22:35 +00:00
|
|
|
Separator {
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.top: parent.top
|
|
|
|
palette: control.palette
|
2025-01-08 08:54:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
TimelineDayModel {
|
|
|
|
id: model
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|