Commit 46dbd6e8 authored by Volker Krause's avatar Volker Krause
Browse files

Also show open-end time intervals

Support for this has recently been added to KOpeningHours.
parent 80554e9a
......@@ -60,19 +60,26 @@ Column {
Rectangle {
id: intervalBox
property var interval: modelData
property var closeColor: Kirigami.Theme.negativeBackgroundColor;
color: {
switch (interval.state) {
case Interval.Open: return Kirigami.Theme.positiveBackgroundColor;
case Interval.Closed: return Kirigami.Theme.negativeBackgroundColor;
case Interval.Closed: return intervalBox.closeColor;
case Interval.Unknown: return Kirigami.Theme.neutralBackgroundColor;
}
return "transparent";
}
width: {
var ratio = (interval.end - interval.begin) / (24 * 60 * 60 * 1000);
var ratio = (interval.estimatedEnd - interval.begin) / (24 * 60 * 60 * 1000);
return ratio * (delegateRoot.ListView.view.width - delegateRoot.ListView.view.labelWidth - Kirigami.Units.smallSpacing);
}
height: Kirigami.Units.gridUnit
gradient: Gradient {
orientation: Gradient.Horizontal
GradientStop { position: 0.0; color: intervalBox.color }
GradientStop { position: (interval.end - interval.begin) / (interval.estimatedEnd - interval.begin); color: intervalBox.color }
GradientStop { position: 1.0; color: interval.hasOpenEndTime ? intervalBox.closeColor : intervalBox.color }
}
QQC2.Label {
id: commentLabel
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment