Changeset View
Changeset View
Standalone View
Standalone View
applets/weather/package/contents/ui/config/ConfigAppearance.qml
Show All 9 Lines | |||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. | ||
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.0 | 18 | import QtQuick 2.5 | ||
19 | import QtQuick.Controls 1.4 as QtControls1 | 19 | import QtQuick.Controls 2.5 as QtControls | ||
20 | import QtQuick.Controls 2.2 as QtControls | | |||
21 | import QtQuick.Layouts 1.3 | | |||
22 | 20 | | |||
21 | import org.kde.kirigami 2.5 as Kirigami | ||||
23 | import org.kde.plasma.private.weather 1.0 | 22 | import org.kde.plasma.private.weather 1.0 | ||
24 | 23 | | |||
25 | 24 | | |||
26 | ColumnLayout { | 25 | Kirigami.FormLayout { | ||
27 | id: displayConfigPage | 26 | id: displayConfigPage | ||
28 | 27 | | |||
29 | readonly property bool canShowMoreInCompactMode: !plasmoid.nativeInterface.needsToBeSquare | 28 | readonly property bool canShowMoreInCompactMode: !plasmoid.nativeInterface.needsToBeSquare | ||
30 | 29 | | |||
31 | signal configurationChanged | 30 | signal configurationChanged | ||
32 | 31 | | |||
33 | function saveConfig() { | 32 | function saveConfig() { | ||
34 | var config = {}; | 33 | var config = {}; | ||
Show All 16 Lines | 46 | Component.onCompleted: { | |||
51 | showWindInTooltipCheckBox.checked = config.showWindInTooltip; | 50 | showWindInTooltipCheckBox.checked = config.showWindInTooltip; | ||
52 | showPressureInTooltipCheckBox.checked = config.showPressureInTooltip; | 51 | showPressureInTooltipCheckBox.checked = config.showPressureInTooltip; | ||
53 | showHumidityInTooltipCheckBox.checked = config.showHumidityInTooltip; | 52 | showHumidityInTooltipCheckBox.checked = config.showHumidityInTooltip; | ||
54 | 53 | | |||
55 | showTemperatureInCompactModeCheckBox.checked = config.showTemperatureInCompactMode; | 54 | showTemperatureInCompactModeCheckBox.checked = config.showTemperatureInCompactMode; | ||
56 | } | 55 | } | ||
57 | 56 | | |||
58 | 57 | | |||
59 | QtControls1.GroupBox { | 58 | Item { | ||
60 | Layout.fillWidth: true | 59 | Kirigami.FormData.isSection: true | ||
61 | flat: true | 60 | Kirigami.FormData.label: i18nc("@title:group", "Compact Mode") | ||
62 | 61 | | |||
63 | title: i18nc("@title:group", "Compact Mode") | 62 | // TODO: conditionalize this once there are also settings for non-compact mode | ||
64 | 63 | visible: false | |||
65 | GridLayout { | | |||
66 | columns: 2 | | |||
67 | | ||||
68 | QtControls.Label { | | |||
69 | Layout.row: 0 | | |||
70 | Layout.column: 0 | | |||
71 | Layout.alignment: Qt.AlignRight | | |||
72 | enabled: canShowMoreInCompactMode | | |||
73 | text: i18nc("@label", "Display:") | | |||
74 | } | 64 | } | ||
75 | 65 | | |||
76 | QtControls.CheckBox { | 66 | QtControls.CheckBox { | ||
77 | id: showTemperatureInCompactModeCheckBox | 67 | id: showTemperatureInCompactModeCheckBox | ||
78 | 68 | | |||
79 | Layout.row: 0 | 69 | Kirigami.FormData.label: i18nc("@label", "Show beside widget icon:") | ||
kossebau: Actually not really correct, things are not shown _on_, but besides the icon.
No idea for… | |||||
80 | Layout.column: 1 | 70 | | ||
81 | enabled: canShowMoreInCompactMode | 71 | enabled: canShowMoreInCompactMode | ||
82 | 72 | | |||
83 | text: i18nc("@option:check", "Show temperature") | 73 | text: i18nc("@option:check Show on widget icon: temperature", "Temperature") | ||
84 | onCheckedChanged: displayConfigPage.configurationChanged(); | 74 | onCheckedChanged: displayConfigPage.configurationChanged(); | ||
85 | } | 75 | } | ||
86 | 76 | | |||
87 | QtControls.Label { | 77 | | ||
88 | Layout.row: 1 | 78 | Item { | ||
89 | Layout.column: 0 | 79 | Kirigami.FormData.isSection: true | ||
90 | Layout.alignment: Qt.AlignRight | | |||
91 | text: i18nc("@label", "Tooltip:") | | |||
92 | } | 80 | } | ||
93 | 81 | | |||
82 | | ||||
94 | QtControls.CheckBox { | 83 | QtControls.CheckBox { | ||
95 | id: showTemperatureInTooltipCheckBox | 84 | id: showTemperatureInTooltipCheckBox | ||
96 | 85 | | |||
97 | Layout.row: 1 | 86 | Kirigami.FormData.label: i18nc("@label", "Show in tooltip:") | ||
98 | Layout.column: 1 | | |||
99 | 87 | | |||
100 | text: i18nc("@option:check", "Show temperature") | 88 | text: i18nc("@option:check", "Temperature") | ||
101 | onCheckedChanged: displayConfigPage.configurationChanged(); | 89 | onCheckedChanged: displayConfigPage.configurationChanged(); | ||
102 | } | 90 | } | ||
103 | 91 | | |||
104 | QtControls.CheckBox { | 92 | QtControls.CheckBox { | ||
105 | id: showWindInTooltipCheckBox | 93 | id: showWindInTooltipCheckBox | ||
106 | 94 | | |||
107 | Layout.row: 2 | 95 | text: i18nc("@option:check Show in tooltip: wind", "Wind") | ||
108 | Layout.column: 1 | | |||
109 | | ||||
110 | text: i18nc("@option:check", "Show wind") | | |||
111 | onCheckedChanged: displayConfigPage.configurationChanged(); | 96 | onCheckedChanged: displayConfigPage.configurationChanged(); | ||
112 | } | 97 | } | ||
113 | 98 | | |||
114 | QtControls.CheckBox { | 99 | QtControls.CheckBox { | ||
115 | id: showPressureInTooltipCheckBox | 100 | id: showPressureInTooltipCheckBox | ||
116 | 101 | | |||
117 | Layout.row: 3 | 102 | text: i18nc("@option:check Show in tooltip: pressure", "Pressure") | ||
118 | Layout.column: 1 | | |||
119 | | ||||
120 | text: i18nc("@option:check", "Show pressure") | | |||
121 | onCheckedChanged: displayConfigPage.configurationChanged(); | 103 | onCheckedChanged: displayConfigPage.configurationChanged(); | ||
122 | } | 104 | } | ||
123 | 105 | | |||
124 | QtControls.CheckBox { | 106 | QtControls.CheckBox { | ||
125 | id: showHumidityInTooltipCheckBox | 107 | id: showHumidityInTooltipCheckBox | ||
126 | 108 | | |||
127 | Layout.row: 4 | 109 | text: i18nc("@option:check Show in tooltip: humidity", "Humidity") | ||
128 | Layout.column: 1 | | |||
129 | | ||||
130 | text: i18nc("@option:check", "Show humidity") | | |||
131 | onCheckedChanged: displayConfigPage.configurationChanged(); | 110 | onCheckedChanged: displayConfigPage.configurationChanged(); | ||
132 | } | 111 | } | ||
133 | } | 112 | } | ||
134 | } | | |||
135 | | ||||
136 | Item { // tighten layout | | |||
137 | Layout.fillHeight: true | | |||
138 | } | | |||
139 | } | |
Actually not really correct, things are not shown _on_, but besides the icon.
No idea for better wording, but the current proposal seems confusing to me.