Commit 1419c48b authored by Nate Graham's avatar Nate Graham
Browse files

[applets/digital-clock] Make current timezone text bold

This is the paradigm we use for highlighting the current/selected item
in various other contexts, and Kirigami.BasicListItem has built-in
facilities for it. Let's use them.
parent ed621240
......@@ -65,9 +65,13 @@ ColumnLayout {
currentIndex: -1
delegate: Kirigami.BasicListItem {
id: timeZoneListItem
property bool isCurrent: plasmoid.configuration.lastSelectedTimezone === model.timeZoneId
// Otherwise the list item changes height when its subtitles appears
implicitHeight: Math.round(Kirigami.Units.gridUnit * 2.5)
bold: isCurrent
// Don't want a highlight effect here because it doesn't look good
hoverEnabled: false
activeBackgroundColor: "transparent"
......@@ -81,13 +85,14 @@ ColumnLayout {
// RadioButton equivalent of Kirigami.CheckableListItem,
// and then port to use that in Plasma 5.22
leading: QQC2.RadioButton {
id: radioButton
visible: configuredTimezoneList.count > 1
checked: plasmoid.configuration.lastSelectedTimezone === model.timeZoneId
checked: timeZoneListItem.isCurrent
onToggled: clickAction.trigger()
}
label: model.city
subtitle: plasmoid.configuration.lastSelectedTimezone === model.timeZoneId && configuredTimezoneList.count > 1 ? i18n("Clock is currently using this time zone") : ""
subtitle: isCurrent && configuredTimezoneList.count > 1 ? i18n("Clock is currently using this time zone") : ""
action: Kirigami.Action {
id: clickAction
......
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