Changeset View
Changeset View
Standalone View
Standalone View
applets/digital-clock/package/contents/ui/configAppearance.qml
Show All 39 Lines | 29 | QtLayouts.ColumnLayout { | |||
---|---|---|---|---|---|
40 | 40 | | |||
41 | property alias cfg_showLocalTimezone: showLocalTimezone.checked | 41 | property alias cfg_showLocalTimezone: showLocalTimezone.checked | ||
42 | property alias cfg_displayTimezoneAsCode: timezoneCodeRadio.checked | 42 | property alias cfg_displayTimezoneAsCode: timezoneCodeRadio.checked | ||
43 | property alias cfg_showSeconds: showSeconds.checked | 43 | property alias cfg_showSeconds: showSeconds.checked | ||
44 | 44 | | |||
45 | property alias cfg_showDate: showDate.checked | 45 | property alias cfg_showDate: showDate.checked | ||
46 | property string cfg_dateFormat: "shortDate" | 46 | property string cfg_dateFormat: "shortDate" | ||
47 | property alias cfg_customDateFormat: customDateFormat.text | 47 | property alias cfg_customDateFormat: customDateFormat.text | ||
48 | property alias cfg_use24hFormat: use24hFormat.checkState | 48 | property alias cfg_use24hFormat: use24hFormat.currentIndex | ||
49 | 49 | | |||
50 | onCfg_fontFamilyChanged: { | 50 | onCfg_fontFamilyChanged: { | ||
51 | // HACK by the time we populate our model and/or the ComboBox is finished the value is still undefined | 51 | // HACK by the time we populate our model and/or the ComboBox is finished the value is still undefined | ||
52 | if (cfg_fontFamily) { | 52 | if (cfg_fontFamily) { | ||
53 | for (var i = 0, j = fontsModel.count; i < j; ++i) { | 53 | for (var i = 0, j = fontsModel.count; i < j; ++i) { | ||
54 | if (fontsModel.get(i).value == cfg_fontFamily) { | 54 | if (fontsModel.get(i).value == cfg_fontFamily) { | ||
55 | fontFamilyComboBox.currentIndex = i | 55 | fontFamilyComboBox.currentIndex = i | ||
56 | break | 56 | break | ||
Show All 27 Lines | 77 | Kirigami.FormLayout { | |||
84 | } | 84 | } | ||
85 | 85 | | |||
86 | QtControls.CheckBox { | 86 | QtControls.CheckBox { | ||
87 | id: showSeconds | 87 | id: showSeconds | ||
88 | text: i18n("Show seconds") | 88 | text: i18n("Show seconds") | ||
89 | } | 89 | } | ||
90 | 90 | | |||
91 | QtControls.CheckBox { | 91 | QtControls.CheckBox { | ||
92 | id: use24hFormat | | |||
93 | text: i18nc("Checkbox label; means 24h clock format, without am/pm", "Use 24-hour Clock") | | |||
94 | tristate: true | | |||
95 | } | | |||
96 | | ||||
97 | QtControls.CheckBox { | | |||
98 | id: showLocalTimezone | 92 | id: showLocalTimezone | ||
99 | text: i18n("Show local time zone") | 93 | text: i18n("Show local time zone") | ||
100 | } | 94 | } | ||
101 | 95 | | |||
102 | Item { | 96 | Item { | ||
103 | Kirigami.FormData.isSection: true | 97 | Kirigami.FormData.isSection: true | ||
104 | } | 98 | } | ||
105 | 99 | | |||
Show All 12 Lines | 100 | QtLayouts.ColumnLayout { | |||
118 | } | 112 | } | ||
119 | } | 113 | } | ||
120 | 114 | | |||
121 | Item { | 115 | Item { | ||
122 | Kirigami.FormData.isSection: true | 116 | Kirigami.FormData.isSection: true | ||
123 | } | 117 | } | ||
124 | 118 | | |||
125 | QtControls.ComboBox { | 119 | QtControls.ComboBox { | ||
120 | id: use24hFormat | ||||
121 | Kirigami.FormData.label: i18n("Time display:") | ||||
122 | model: [ | ||||
123 | i18n("12-hour"), | ||||
124 | i18n("Use locale default"), | ||||
125 | i18n("24-hour") | ||||
126 | ] | ||||
127 | onCurrentIndexChanged: cfg_use24hFormat = currentIndex | ||||
128 | } | ||||
129 | | ||||
130 | Item { | ||||
131 | Kirigami.FormData.isSection: true | ||||
132 | } | ||||
133 | | ||||
134 | QtControls.ComboBox { | ||||
126 | id: dateFormat | 135 | id: dateFormat | ||
127 | Kirigami.FormData.label: i18n("Date format:") | 136 | Kirigami.FormData.label: i18n("Date format:") | ||
Zren: Was afk today sorry.
Do we need `visible: KCMShell.authorize("formats.desktop").length > 0`… | |||||
ngraham: Good Idea, I'll push that in a few minutes. | |||||
128 | enabled: showDate.checked | 137 | enabled: showDate.checked | ||
129 | textRole: "label" | 138 | textRole: "label" | ||
130 | model: [ | 139 | model: [ | ||
131 | { | 140 | { | ||
132 | 'label': i18n("Long Date"), | 141 | 'label': i18n("Long Date"), | ||
133 | 'name': "longDate" | 142 | 'name': "longDate" | ||
134 | }, | 143 | }, | ||
135 | { | 144 | { | ||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |
Was afk today sorry.
Do we need visible: KCMShell.authorize("formats.desktop").length > 0 here? It hides the contextmenu item in main.qml if the user doesn't have permission.
https://github.com/KDE/plasma-workspace/blob/master/applets/digital-clock/package/contents/ui/main.qml#L109