Commit ef213aaa authored by Nate Graham's avatar Nate Graham 🔩

[applets/weather] Improve UX for selecting a weather station

Summary:
This patch improves the UX of selecting a weather station by re-implementing it a column
of checkboxes that are visible by default at the top of the window, so that selecting a
weather station is follows the local top-to-bottom flow of the page.

When no weather stations are selected (as it is by default), everything else in the
window is disabled so it's completely obvious what you need to do to proceed.

Test Plan: {F8256457}

Reviewers: #vdg, #plasma, broulik, kossebau, spstarr

Reviewed By: #plasma, spstarr

Subscribers: ndavis, spstarr, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D29144
parent 6e196a65
......@@ -61,31 +61,32 @@ ColumnLayout {
id: serviceListModel
}
QQC2.Menu {
id: serviceSelectionMenu
Instantiator {
model: serviceListModel
delegate: QQC2.MenuItem {
text: model.display
checkable: true
checked: model.checked
onToggled: {
model.checked = checked;
checked = Qt.binding(function() { return model.checked; });
weatherStationConfigPage.configurationChanged();
Kirigami.FormLayout {
ColumnLayout {
Kirigami.FormData.label: i18n("Weather providers:")
Kirigami.FormData.buddyFor: calendarPluginsRepeater.itemAt(0)
Repeater {
id: calendarPluginsRepeater
model: serviceListModel
delegate: QQC2.CheckBox {
text: model.display
checked: model.checked
onToggled: {
model.checked = checked;
checked = Qt.binding(function() { return model.checked; });
weatherStationConfigPage.configurationChanged();
}
}
}
onObjectAdded: serviceSelectionMenu.insertItem(index, object)
onObjectRemoved: serviceSelectionMenu.removeItem(object)
}
}
RowLayout {
Layout.fillWidth: true
enabled: selectedServices.length > 0
Kirigami.SearchField {
id: searchStringEdit
......@@ -98,21 +99,6 @@ ColumnLayout {
}
}
QQC2.Button {
id: serviceSelectionButton
icon.name: "services"
checkable: true
checked: serviceSelectionMenu.opened
onClicked: serviceSelectionMenu.popup(serviceSelectionButton, serviceSelectionButton.width - serviceSelectionMenu.width, serviceSelectionButton.height)
QQC2.ToolTip {
text: i18nc("@info:tooltip", "Select weather services providers")
visible: hovered
}
}
QQC2.Button {
id: searchButton
......@@ -130,6 +116,8 @@ ColumnLayout {
Layout.fillWidth: true
Layout.fillHeight: true
enabled: selectedServices.length > 0
Component.onCompleted: {
background.visible = true;
}
......
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