Commit 3bcf2802 authored by Ismael Asensio's avatar Ismael Asensio
Browse files

[applets/digitalclock] Improve TimeZone selector visuals

- Make the list adpatable instead of a fixed height. Now the list
  resizes with the window.
- Improve the placehoder placement
- Rework the bottom spacing reserved for the checkbox and the note
- Add again the overlay close button as it doesn't interfere anymore
- Workaround Qt bug to hide horizontal scrollbar
parent a4d1b461
......@@ -49,9 +49,12 @@ ColumnLayout {
QQC2.ScrollView {
Layout.fillWidth: true
Layout.preferredHeight: Kirigami.Units.gridUnit * 16
Layout.fillHeight: true
Component.onCompleted: background.visible = true // enable border
// HACK: Hide unnecesary horizontal scrollbar (https://bugreports.qt.io/browse/QTBUG-83890)
QQC2.ScrollBar.horizontal.policy: QQC2.ScrollBar.AlwaysOff
ListView {
id: configuredTimezoneList
clip: true // Avoid visual glitches
......@@ -127,8 +130,13 @@ ColumnLayout {
Kirigami.PlaceholderMessage {
visible: configuredTimezoneList.count === 1
anchors.centerIn: parent
width: parent.width - (Kirigami.Units.largeSpacing * 12)
anchors {
top: parent.verticalCenter // Visual offset for system timezone and header
left: parent.left
right: parent.right
leftMargin: Kirigami.Units.largeSpacing * 6
rightMargin: Kirigami.Units.largeSpacing * 6
}
text: i18n("Add more time zones to display all of them in the applet's pop-up, or use one of them for the clock itself")
}
}
......@@ -143,19 +151,23 @@ ColumnLayout {
QQC2.CheckBox {
id: enableWheelCheckBox
visible: configuredTimezoneList.count > 1
enabled: configuredTimezoneList.count > 1
Layout.fillWidth: true
Layout.topMargin: Kirigami.Units.largeSpacing * 2
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.bottomMargin: Kirigami.Units.largeSpacing
text: i18n("Switch displayed time zone by scrolling over clock applet")
}
Kirigami.Separator {
Layout.fillWidth: true
}
QQC2.Label {
visible: configuredTimezoneList.count > 1
Layout.fillWidth: true
Layout.topMargin: Kirigami.Units.largeSpacing * 2
Layout.leftMargin: Kirigami.Units.largeSpacing * 2
Layout.rightMargin: Kirigami.Units.largeSpacing * 2
text: i18n("Note that using a different time zone for the clock does not change the systemwide local time zone. When you travel, switch the local time zone instead.")
font: Kirigami.Theme.smallFont
wrapMode: Text.Wrap
}
......@@ -178,9 +190,6 @@ ColumnLayout {
// Need to manually set the parent when using this in a Plasma config dialog
parent: timeZonesPage.parent
// It interferes with the search field in the header
showCloseButton: false
header: ColumnLayout {
Layout.preferredWidth: Kirigami.Units.gridUnit * 25
......
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