Changeset View
Changeset View
Standalone View
Standalone View
applets/digital-clock/package/contents/ui/configAppearance.qml
Show All 40 Lines | 30 | QtLayouts.ColumnLayout { | |||
---|---|---|---|---|---|
41 | property alias cfg_displayTimezoneAsCode: timezoneCodeRadio.checked | 41 | property alias cfg_displayTimezoneAsCode: timezoneCodeRadio.checked | ||
42 | property alias cfg_showSeconds: showSeconds.checked | 42 | property alias cfg_showSeconds: showSeconds.checked | ||
43 | 43 | | |||
44 | property alias cfg_showDate: showDate.checked | 44 | property alias cfg_showDate: showDate.checked | ||
45 | property string cfg_dateFormat: "shortDate" | 45 | property string cfg_dateFormat: "shortDate" | ||
46 | property alias cfg_customDateFormat: customDateFormat.text | 46 | property alias cfg_customDateFormat: customDateFormat.text | ||
47 | property alias cfg_use24hFormat: use24hFormat.currentIndex | 47 | property alias cfg_use24hFormat: use24hFormat.currentIndex | ||
48 | 48 | | |||
49 | onCfg_fontFamilyChanged: { | 49 | function onCfg_fontFamilyChanged() { | ||
50 | // HACK by the time we populate our model and/or the ComboBox is finished the value is still undefined | 50 | // HACK by the time we populate our model and/or the ComboBox is finished the value is still undefined | ||
51 | if (cfg_fontFamily) { | 51 | if (cfg_fontFamily) { | ||
52 | for (var i = 0, j = fontsModel.count; i < j; ++i) { | 52 | for (var i = 0, j = fontsModel.count; i < j; ++i) { | ||
53 | if (fontsModel.get(i).value === cfg_fontFamily) { | 53 | if (fontsModel.get(i).value === cfg_fontFamily) { | ||
54 | fontFamilyComboBox.currentIndex = i | 54 | fontFamilyComboBox.currentIndex = i | ||
55 | break | 55 | break | ||
56 | } | 56 | } | ||
57 | } | 57 | } | ||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 118 | QtLayouts.RowLayout { | |||
121 | 121 | | |||
122 | QtControls.ComboBox { | 122 | QtControls.ComboBox { | ||
123 | id: use24hFormat | 123 | id: use24hFormat | ||
124 | model: [ | 124 | model: [ | ||
125 | i18n("12-Hour"), | 125 | i18n("12-Hour"), | ||
126 | i18n("Use Region Defaults"), | 126 | i18n("Use Region Defaults"), | ||
127 | i18n("24-Hour") | 127 | i18n("24-Hour") | ||
128 | ] | 128 | ] | ||
129 | onCurrentIndexChanged: cfg_use24hFormat = currentIndex | 129 | function onCurrentIndexChanged() { cfg_use24hFormat = currentIndex } | ||
130 | } | 130 | } | ||
131 | 131 | | |||
132 | QtControls.Button { | 132 | QtControls.Button { | ||
133 | visible: KCMShell.authorize("formats.desktop").length > 0 | 133 | visible: KCMShell.authorize("formats.desktop").length > 0 | ||
134 | text: i18n("Change Regional Settings...") | 134 | text: i18n("Change Regional Settings...") | ||
135 | icon.name: "preferences-desktop-locale" | 135 | icon.name: "preferences-desktop-locale" | ||
136 | onClicked: KCMShell.open("formats.desktop") | 136 | onClicked: KCMShell.open("formats.desktop") | ||
137 | } | 137 | } | ||
Show All 26 Lines | 162 | { | |||
164 | 'name': "isoDate", | 164 | 'name': "isoDate", | ||
165 | format: Qt.ISODate | 165 | format: Qt.ISODate | ||
166 | }, | 166 | }, | ||
167 | { | 167 | { | ||
168 | 'label': i18nc("custom date format", "Custom"), | 168 | 'label': i18nc("custom date format", "Custom"), | ||
169 | 'name': "custom" | 169 | 'name': "custom" | ||
170 | } | 170 | } | ||
171 | ] | 171 | ] | ||
172 | onCurrentIndexChanged: cfg_dateFormat = model[currentIndex]["name"] | 172 | function onCurrentIndexChanged() { cfg_dateFormat = model[currentIndex]["name"] } | ||
173 | 173 | | |||
174 | Component.onCompleted: { | 174 | Component.onCompleted: { | ||
175 | for (var i = 0; i < model.length; i++) { | 175 | for (var i = 0; i < model.length; i++) { | ||
176 | if (model[i]["name"] === plasmoid.configuration.dateFormat) { | 176 | if (model[i]["name"] === plasmoid.configuration.dateFormat) { | ||
177 | dateFormat.currentIndex = i; | 177 | dateFormat.currentIndex = i; | ||
178 | } | 178 | } | ||
179 | } | 179 | } | ||
180 | } | 180 | } | ||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | 223 | QtControls.ComboBox { | |||
225 | QtLayouts.Layout.fillWidth: true | 225 | QtLayouts.Layout.fillWidth: true | ||
226 | currentIndex: 0 | 226 | currentIndex: 0 | ||
227 | // ComboBox's sizing is just utterly broken | 227 | // ComboBox's sizing is just utterly broken | ||
228 | QtLayouts.Layout.minimumWidth: units.gridUnit * 10 | 228 | QtLayouts.Layout.minimumWidth: units.gridUnit * 10 | ||
229 | model: fontsModel | 229 | model: fontsModel | ||
230 | // doesn't autodeduce from model because we manually populate it | 230 | // doesn't autodeduce from model because we manually populate it | ||
231 | textRole: "text" | 231 | textRole: "text" | ||
232 | 232 | | |||
233 | onCurrentIndexChanged: { | 233 | function onCurrentIndexChanged() { | ||
234 | var current = model.get(currentIndex) | 234 | var current = model.get(currentIndex) | ||
235 | if (current) { | 235 | if (current) { | ||
236 | cfg_fontFamily = current.value | 236 | cfg_fontFamily = current.value | ||
237 | appearancePage.configurationChanged() | 237 | appearancePage.configurationChanged() | ||
238 | } | 238 | } | ||
239 | } | 239 | } | ||
240 | } | 240 | } | ||
241 | 241 | | |||
Show All 33 Lines |