Commit 83ceca96 authored by Carl Schwan's avatar Carl Schwan 🚴 Committed by Claudio Cambra
Browse files

Add background back in hourly view

Otherwise, it is hard to see the duration of events. Also make the background a bit more opaque to still get the not too heavy on color interface.
parent 7c2e7d13
Pipeline #228143 passed with stage
in 2 minutes and 28 seconds
......@@ -11,6 +11,7 @@ import "labelutils.js" as LabelUtils
Kirigami.ShadowedRectangle {
id: incidenceDelegateBackground
property bool isInHourlyView: false
property bool isOpenOccurrence: false
property bool reactToCurrentMonth: false
property bool isInCurrentMonth: true
......@@ -18,10 +19,14 @@ Kirigami.ShadowedRectangle {
property bool allDay: false
anchors.fill: parent
color: isOpenOccurrence ? modelData.color :
color: isOpenOccurrence || isInHourlyView ? modelData.color :
LabelUtils.getIncidenceDelegateBackgroundColor(modelData.color, root.isDark, modelData.endTime, Kalendar.Config.pastEventsTransparencyLevel)
Behavior on color { ColorAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.OutCubic } }
opacity: isOpenOccurrence || (isInCurrentMonth && allDay) ? 1.0 : 0
opacity: if (isInHourlyView) {
return isOpenOccurrence ? 0.5 : 0.1
} else {
return isOpenOccurrence || (isInCurrentMonth && allDay) ? 1 : 0
}
Behavior on opacity { NumberAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.OutCubic } }
radius: Kirigami.Units.smallSpacing
......
......@@ -1004,6 +1004,7 @@ Kirigami.Page {
id: incidenceDelegateBackground
isOpenOccurrence: parent.isOpenOccurrence
isDark: root.isDark
isInHourlyView: true
}
ColumnLayout {
......@@ -1035,8 +1036,7 @@ Kirigami.Page {
font.weight: Font.Medium
font.strikeout: modelData.todoCompleted
renderType: Text.QtRendering
color: isOpenOccurrence ? (LabelUtils.isDarkColor(modelData.color) ? "white" : "black") :
incidenceContents.textColor
color: incidenceContents.textColor
Behavior on color { ColorAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.OutCubic } }
}
......
Supports Markdown
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