Commit 65b4e72b authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Fixed time labels sometimes overlapping with icons in schedule view cards

parent 56254c63
Pipeline #96344 passed with stage
in 6 minutes and 18 seconds
...@@ -31,6 +31,7 @@ Kirigami.Page { ...@@ -31,6 +31,7 @@ Kirigami.Page {
property bool initialMonth: true property bool initialMonth: true
readonly property bool isLarge: width > Kirigami.Units.gridUnit * 30 readonly property bool isLarge: width > Kirigami.Units.gridUnit * 30
readonly property bool isDark: LabelUtils.isDarkColor(Kirigami.Theme.backgroundColor) readonly property bool isDark: LabelUtils.isDarkColor(Kirigami.Theme.backgroundColor)
property real maxTimeLabelWidth: 0
onSelectedDateChanged: moveToSelected() onSelectedDateChanged: moveToSelected()
...@@ -389,7 +390,7 @@ Kirigami.Page { ...@@ -389,7 +390,7 @@ Kirigami.Page {
Behavior on color { ColorAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.OutCubic } } Behavior on color { ColorAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.OutCubic } }
text: { text: {
if(incidenceCard.multiday) { if(incidenceCard.multiday) {
return i18n("%1 (Day %2 of %3)", modelData.text, incidenceCard.dayOfMultidayIncidence, incidenceCard.incidenceDays); return i18nc("%1 is the name of the event", "%1 (Day %2 of %3)", modelData.text, incidenceCard.dayOfMultidayIncidence, incidenceCard.incidenceDays);
} else { } else {
return modelData.text; return modelData.text;
} }
...@@ -434,8 +435,8 @@ Kirigami.Page { ...@@ -434,8 +435,8 @@ Kirigami.Page {
QQC2.Label { QQC2.Label {
Layout.fillHeight: true Layout.fillHeight: true
// This way all the icons are aligned // This way all the icons are aligned
Layout.maximumWidth: Kirigami.Units.gridUnit * 7 Layout.maximumWidth: root.maxTimeLabelWidth
Layout.minimumWidth: Kirigami.Units.gridUnit * 7 Layout.minimumWidth: root.maxTimeLabelWidth
Layout.column: root.isLarge ? 2 : 0 Layout.column: root.isLarge ? 2 : 0
Layout.row: root.isLarge ? 0 : 1 Layout.row: root.isLarge ? 0 : 1
...@@ -459,6 +460,7 @@ Kirigami.Page { ...@@ -459,6 +460,7 @@ Kirigami.Page {
i18n("Runs All Day") i18n("Runs All Day")
} }
} }
Component.onCompleted: if(implicitWidth > root.maxTimeLabelWidth) root.maxTimeLabelWidth = implicitWidth
} }
} }
......
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