diff --git a/applets/weather/package/contents/ui/config/ConfigWeatherStation.qml b/applets/weather/package/contents/ui/config/ConfigWeatherStation.qml --- a/applets/weather/package/contents/ui/config/ConfigWeatherStation.qml +++ b/applets/weather/package/contents/ui/config/ConfigWeatherStation.qml @@ -16,7 +16,7 @@ */ import QtQuick 2.9 -import QtQuick.Controls 2.5 as QtControls +import QtQuick.Controls 2.5 as QQC2 import QtQuick.Layouts 1.3 import org.kde.kirigami 2.5 as Kirigami @@ -66,7 +66,7 @@ Kirigami.FormData.label: i18nc("@label", "Location:") Layout.fillWidth: true - QtControls.Label { + QQC2.Label { id: locationDisplay Layout.fillWidth: true elide: Text.ElideRight @@ -82,16 +82,16 @@ } } - QtControls.Button { + QQC2.Button { id: selectButton Layout.fillWidth: true icon.name: "find-location" text: i18nc("@action:button", "Choose...") onClicked: stationPicker.visible = true; } } - QtControls.SpinBox { + QQC2.SpinBox { id: updateIntervalSpin Kirigami.FormData.label: i18nc("@label:spinbox", "Update every:") diff --git a/applets/weather/package/contents/ui/config/WeatherStationPicker.qml b/applets/weather/package/contents/ui/config/WeatherStationPicker.qml --- a/applets/weather/package/contents/ui/config/WeatherStationPicker.qml +++ b/applets/weather/package/contents/ui/config/WeatherStationPicker.qml @@ -17,11 +17,10 @@ import QtQuick 2.9 -import QtQuick.Controls 1.4 as QtControls +import QtQuick.Controls 1.4 as QQC1 +import QtQuick.Controls 2.5 as QQC2 import QtQuick.Layouts 1.3 -import org.kde.plasma.components 2.0 as PlasmaComponents - import org.kde.plasma.private.weather 1.0 @@ -64,12 +63,12 @@ id: serviceListModel } - QtControls.Menu { + QQC2.Menu { id: serviceSelectionMenu Instantiator { model: serviceListModel - delegate: QtControls.MenuItem { + delegate: QQC2.MenuItem { text: model.display checkable: true checked: model.checked @@ -89,7 +88,7 @@ RowLayout { Layout.fillWidth: true - QtControls.TextField { + QQC2.TextField { id: searchStringEdit Layout.fillWidth: true @@ -100,30 +99,25 @@ } } - QtControls.Button { + QQC2.Button { id: serviceSelectionButton - iconName: "services" - tooltip: i18nc("@info:tooltip", "Select weather services providers") - menu: serviceSelectionMenu - } - - Item { - Layout.preferredHeight: Math.max(searchButton.height, searchStringEdit.height) - Layout.preferredWidth: Layout.preferredHeight + icon.name: "services" - PlasmaComponents.BusyIndicator { - id: busy + checkable: true + checked: serviceSelectionMenu.opened + onClicked: serviceSelectionMenu.popup(serviceSelectionButton, serviceSelectionButton.width - serviceSelectionMenu.width, serviceSelectionButton.height) - anchors.fill: parent - visible: locationListModel.validatingInput + QQC2.ToolTip { + text: i18nc("@info:tooltip", "Select weather services providers") + visible: hovered } } - QtControls.Button { + QQC2.Button { id: searchButton - iconName: "edit-find" + icon.name: "edit-find" text: i18nc("@action:button", "Search") enabled: canSearch @@ -133,7 +127,7 @@ } } - QtControls.TableView { + QQC1.TableView { id: locationListView Layout.minimumWidth: implicitWidth @@ -150,23 +144,33 @@ } } - QtControls.TableViewColumn { + QQC1.TableViewColumn { id: locationListViewStationColumn movable: false resizable: false role: "display" } - QtControls.Label { + QQC2.Label { id: noSearchResultReport anchors.fill: parent horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter wrapMode: Text.WordWrap visible: false } + + QQC2.BusyIndicator { + id: busy + + anchors.centerIn: parent + width: Kirigami.Units.gridUnit + height: width + + visible: locationListModel.validatingInput + } } Component.onCompleted: { diff --git a/applets/weather/package/contents/ui/config/WeatherStationPickerDialog.qml b/applets/weather/package/contents/ui/config/WeatherStationPickerDialog.qml --- a/applets/weather/package/contents/ui/config/WeatherStationPickerDialog.qml +++ b/applets/weather/package/contents/ui/config/WeatherStationPickerDialog.qml @@ -18,10 +18,9 @@ import QtQuick 2.9 import QtQuick.Window 2.2 -import QtQuick.Controls 1.4 as QtControls +import QtQuick.Controls 2.5 as QQC2 import QtQuick.Layouts 1.3 -import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.kirigami 2.5 as Kirigami @@ -54,7 +53,7 @@ id: syspal } - QtControls.Action { + QQC2.Action { id: acceptAction shortcut: "Return" @@ -65,7 +64,7 @@ } } - QtControls.Action { + QQC2.Action { id: cancelAction shortcut: "Escape" @@ -78,7 +77,7 @@ id: mainColumn anchors { fill: parent - margins: mainColumn.spacing * units.devicePixelRatio //margins are hardcoded in QStyle we should match that here + margins: mainColumn.spacing * Screen.devicePixelRatio //margins are hardcoded in QStyle we should match that here } WeatherStationPicker { @@ -93,16 +92,16 @@ Layout.alignment: Qt.AlignVCenter | Qt.AlignRight - QtControls.Button { + QQC2.Button { enabled: !!source - iconName: "dialog-ok" + icon.name: "dialog-ok" text: i18nc("@action:button", "Select") onClicked: { acceptAction.trigger(); } } - QtControls.Button { - iconName: "dialog-cancel" + QQC2.Button { + icon.name: "dialog-cancel" text: i18nc("@action:button", "Cancel") onClicked: { cancelAction.trigger();