Differential D25509 Diff 70385 applets/weather/package/contents/ui/config/WeatherStationPickerDialog.qml
Changeset View
Changeset View
Standalone View
Standalone View
applets/weather/package/contents/ui/config/WeatherStationPickerDialog.qml
Show All 12 Lines | |||||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | import QtQuick 2.9 | 18 | import QtQuick 2.9 | ||
19 | 19 | | |||
20 | import QtQuick.Window 2.2 | 20 | import QtQuick.Window 2.2 | ||
21 | import QtQuick.Controls 1.4 as QtControls | 21 | import QtQuick.Controls 2.5 as QQC2 | ||
22 | import QtQuick.Layouts 1.3 | 22 | import QtQuick.Layouts 1.3 | ||
23 | 23 | | |||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | | |||
25 | import org.kde.kirigami 2.5 as Kirigami | 24 | import org.kde.kirigami 2.5 as Kirigami | ||
26 | 25 | | |||
27 | 26 | | |||
28 | Window { | 27 | Window { | ||
29 | id: dialog | 28 | id: dialog | ||
30 | 29 | | |||
31 | LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft | 30 | LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft | ||
32 | LayoutMirroring.childrenInherit: true | 31 | LayoutMirroring.childrenInherit: true | ||
Show All 16 Lines | 47 | function close() { | |||
49 | dialog.visible = false; | 48 | dialog.visible = false; | ||
50 | } | 49 | } | ||
51 | 50 | | |||
52 | 51 | | |||
53 | SystemPalette { | 52 | SystemPalette { | ||
54 | id: syspal | 53 | id: syspal | ||
55 | } | 54 | } | ||
56 | 55 | | |||
57 | QtControls.Action { | 56 | QQC2.Action { | ||
58 | id: acceptAction | 57 | id: acceptAction | ||
59 | 58 | | |||
60 | shortcut: "Return" | 59 | shortcut: "Return" | ||
61 | enabled: !!source && !stationPicker.handlesEnterKey | 60 | enabled: !!source && !stationPicker.handlesEnterKey | ||
62 | onTriggered: { | 61 | onTriggered: { | ||
63 | accepted(); | 62 | accepted(); | ||
64 | dialog.close(); | 63 | dialog.close(); | ||
65 | } | 64 | } | ||
66 | } | 65 | } | ||
67 | 66 | | |||
68 | QtControls.Action { | 67 | QQC2.Action { | ||
69 | id: cancelAction | 68 | id: cancelAction | ||
70 | 69 | | |||
71 | shortcut: "Escape" | 70 | shortcut: "Escape" | ||
72 | onTriggered: { | 71 | onTriggered: { | ||
73 | dialog.close(); | 72 | dialog.close(); | ||
74 | } | 73 | } | ||
75 | } | 74 | } | ||
76 | 75 | | |||
77 | ColumnLayout { | 76 | ColumnLayout { | ||
78 | id: mainColumn | 77 | id: mainColumn | ||
79 | anchors { | 78 | anchors { | ||
80 | fill: parent | 79 | fill: parent | ||
81 | margins: mainColumn.spacing * units.devicePixelRatio //margins are hardcoded in QStyle we should match that here | 80 | margins: mainColumn.spacing * Screen.devicePixelRatio //margins are hardcoded in QStyle we should match that here | ||
82 | } | 81 | } | ||
83 | 82 | | |||
84 | WeatherStationPicker { | 83 | WeatherStationPicker { | ||
85 | id: stationPicker | 84 | id: stationPicker | ||
86 | 85 | | |||
87 | Layout.fillWidth: true | 86 | Layout.fillWidth: true | ||
88 | Layout.fillHeight: true | 87 | Layout.fillHeight: true | ||
89 | } | 88 | } | ||
90 | 89 | | |||
91 | RowLayout { | 90 | RowLayout { | ||
92 | id: buttonsRow | 91 | id: buttonsRow | ||
93 | 92 | | |||
94 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | 93 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||
95 | 94 | | |||
96 | QtControls.Button { | 95 | QQC2.Button { | ||
97 | enabled: !!source | 96 | enabled: !!source | ||
98 | iconName: "dialog-ok" | 97 | icon.name: "dialog-ok" | ||
99 | text: i18nc("@action:button", "Select") | 98 | text: i18nc("@action:button", "Select") | ||
100 | onClicked: { | 99 | onClicked: { | ||
101 | acceptAction.trigger(); | 100 | acceptAction.trigger(); | ||
102 | } | 101 | } | ||
103 | } | 102 | } | ||
104 | QtControls.Button { | 103 | QQC2.Button { | ||
105 | iconName: "dialog-cancel" | 104 | icon.name: "dialog-cancel" | ||
106 | text: i18nc("@action:button", "Cancel") | 105 | text: i18nc("@action:button", "Cancel") | ||
107 | onClicked: { | 106 | onClicked: { | ||
108 | cancelAction.trigger(); | 107 | cancelAction.trigger(); | ||
109 | } | 108 | } | ||
110 | } | 109 | } | ||
111 | } | 110 | } | ||
112 | } | 111 | } | ||
113 | } | 112 | } |