Changeset View
Changeset View
Standalone View
Standalone View
applets/weather/package/contents/ui/config/ConfigAppearance.qml
Context not available. | |||||
26 | ColumnLayout { | 26 | ColumnLayout { | ||
---|---|---|---|---|---|
27 | id: displayConfigPage | 27 | id: displayConfigPage | ||
28 | 28 | | |||
29 | readonly property bool canShowMoreInCompactMode: !plasmoid.nativeInterface.needsToBeSquare | 29 | property alias cfg_showTemperatureInTooltip: showTemperatureInTooltipCheckBox.checked | ||
30 | 30 | property alias cfg_showWindInTooltip: showWindInTooltipCheckBox.checked | |||
31 | signal configurationChanged | 31 | property alias cfg_showPressureInTooltip: showPressureInTooltipCheckBox.checked | ||
32 | 32 | property alias cfg_showHumidityInTooltip: showHumidityInTooltipCheckBox.checked | |||
33 | function saveConfig() { | | |||
34 | var config = {}; | | |||
35 | | ||||
36 | config.showTemperatureInTooltip = showTemperatureInTooltipCheckBox.checked; | | |||
37 | config.showWindInTooltip = showWindInTooltipCheckBox.checked; | | |||
38 | config.showPressureInTooltip = showPressureInTooltipCheckBox.checked; | | |||
39 | config.showHumidityInTooltip = showHumidityInTooltipCheckBox.checked; | | |||
40 | | ||||
41 | config.showTemperatureInCompactMode = showTemperatureInCompactModeCheckBox.checked; | | |||
42 | | ||||
43 | plasmoid.nativeInterface.saveConfig(config); | | |||
44 | plasmoid.nativeInterface.configChanged(); | | |||
45 | } | | |||
46 | | ||||
47 | Component.onCompleted: { | | |||
48 | var config = plasmoid.nativeInterface.configValues(); | | |||
49 | | ||||
50 | showTemperatureInTooltipCheckBox.checked = config.showTemperatureInTooltip; | | |||
51 | showWindInTooltipCheckBox.checked = config.showWindInTooltip; | | |||
52 | showPressureInTooltipCheckBox.checked = config.showPressureInTooltip; | | |||
53 | showHumidityInTooltipCheckBox.checked = config.showHumidityInTooltip; | | |||
54 | | ||||
55 | showTemperatureInCompactModeCheckBox.checked = config.showTemperatureInCompactMode; | | |||
56 | } | | |||
57 | 33 | | |||
34 | property alias cfg_showTemperatureInCompactMode: showTemperatureInCompactModeCheckBox.checked | ||||
35 | readonly property bool canShowMoreInCompactMode: !plasmoid.configuration.needsToBeSquare | ||||
58 | 36 | | |||
59 | QtControls1.GroupBox { | 37 | QtControls1.GroupBox { | ||
60 | Layout.fillWidth: true | 38 | Layout.fillWidth: true | ||
Context not available. | |||||
81 | enabled: canShowMoreInCompactMode | 59 | enabled: canShowMoreInCompactMode | ||
82 | 60 | | |||
83 | text: i18nc("@option:check", "Show temperature") | 61 | text: i18nc("@option:check", "Show temperature") | ||
84 | onCheckedChanged: displayConfigPage.configurationChanged(); | | |||
85 | } | 62 | } | ||
86 | 63 | | |||
87 | QtControls.Label { | 64 | QtControls.Label { | ||
Context not available. | |||||
98 | Layout.column: 1 | 75 | Layout.column: 1 | ||
99 | 76 | | |||
100 | text: i18nc("@option:check", "Show temperature") | 77 | text: i18nc("@option:check", "Show temperature") | ||
101 | onCheckedChanged: displayConfigPage.configurationChanged(); | | |||
102 | } | 78 | } | ||
103 | 79 | | |||
104 | QtControls.CheckBox { | 80 | QtControls.CheckBox { | ||
Context not available. | |||||
108 | Layout.column: 1 | 84 | Layout.column: 1 | ||
109 | 85 | | |||
110 | text: i18nc("@option:check", "Show wind") | 86 | text: i18nc("@option:check", "Show wind") | ||
111 | onCheckedChanged: displayConfigPage.configurationChanged(); | | |||
112 | } | 87 | } | ||
113 | 88 | | |||
114 | QtControls.CheckBox { | 89 | QtControls.CheckBox { | ||
Context not available. | |||||
118 | Layout.column: 1 | 93 | Layout.column: 1 | ||
119 | 94 | | |||
120 | text: i18nc("@option:check", "Show pressure") | 95 | text: i18nc("@option:check", "Show pressure") | ||
121 | onCheckedChanged: displayConfigPage.configurationChanged(); | | |||
122 | } | 96 | } | ||
123 | 97 | | |||
124 | QtControls.CheckBox { | 98 | QtControls.CheckBox { | ||
Context not available. | |||||
128 | Layout.column: 1 | 102 | Layout.column: 1 | ||
129 | 103 | | |||
130 | text: i18nc("@option:check", "Show humidity") | 104 | text: i18nc("@option:check", "Show humidity") | ||
131 | onCheckedChanged: displayConfigPage.configurationChanged(); | | |||
132 | } | 105 | } | ||
133 | } | 106 | } | ||
134 | } | 107 | } | ||
Context not available. |