Changeset View
Changeset View
Standalone View
Standalone View
applets/digital-clock/package/contents/ui/configAppearance.qml
Show All 38 Lines | 29 | QtLayouts.ColumnLayout { | |||
---|---|---|---|---|---|
39 | property alias cfg_italicText: italicCheckBox.checked | 39 | property alias cfg_italicText: italicCheckBox.checked | ||
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_use24hFormat: use24hFormat.checked | 48 | property alias cfg_use24hFormat: use24hFormat.checked | ||
48 | 49 | | |||
49 | onCfg_fontFamilyChanged: { | 50 | onCfg_fontFamilyChanged: { | ||
50 | // 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 | ||
51 | if (cfg_fontFamily) { | 52 | if (cfg_fontFamily) { | ||
52 | for (var i = 0, j = fontsModel.count; i < j; ++i) { | 53 | for (var i = 0, j = fontsModel.count; i < j; ++i) { | ||
53 | if (fontsModel.get(i).value == cfg_fontFamily) { | 54 | if (fontsModel.get(i).value == cfg_fontFamily) { | ||
54 | fontFamilyComboBox.currentIndex = i | 55 | fontFamilyComboBox.currentIndex = i | ||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 129 | model: [ | |||
132 | }, | 133 | }, | ||
133 | { | 134 | { | ||
134 | 'label': i18n("Short Date"), | 135 | 'label': i18n("Short Date"), | ||
135 | 'name': "shortDate" | 136 | 'name': "shortDate" | ||
136 | }, | 137 | }, | ||
137 | { | 138 | { | ||
138 | 'label': i18n("ISO Date"), | 139 | 'label': i18n("ISO Date"), | ||
139 | 'name': "isoDate" | 140 | 'name': "isoDate" | ||
141 | }, | ||||
142 | { | ||||
143 | 'label': i18nc("custom date format", "Custom"), | ||||
144 | 'name': "custom" | ||||
140 | } | 145 | } | ||
Zren: Does this also need a `i18nc("custom date format", "Custom")` translation context? | |||||
141 | ] | 146 | ] | ||
142 | onCurrentIndexChanged: cfg_dateFormat = model[currentIndex]["name"] | 147 | onCurrentIndexChanged: cfg_dateFormat = model[currentIndex]["name"] | ||
143 | 148 | | |||
144 | Component.onCompleted: { | 149 | Component.onCompleted: { | ||
145 | for (var i = 0; i < model.length; i++) { | 150 | for (var i = 0; i < model.length; i++) { | ||
146 | if (model[i]["name"] == plasmoid.configuration.dateFormat) { | 151 | if (model[i]["name"] == plasmoid.configuration.dateFormat) { | ||
147 | dateFormat.currentIndex = i; | 152 | dateFormat.currentIndex = i; | ||
148 | } | 153 | } | ||
149 | } | 154 | } | ||
150 | } | 155 | } | ||
151 | } | 156 | } | ||
152 | 157 | | |||
158 | QtControls.TextField { | ||||
159 | id: customDateFormat | ||||
160 | QtLayouts.Layout.fillWidth: true | ||||
161 | visible: cfg_dateFormat == "custom" | ||||
162 | } | ||||
163 | | ||||
164 | QtControls.Label { | ||||
165 | text: i18n("<a href=\"http://doc.qt.io/qt-5/qml-qtqml-qt.html#formatDateTime-method\">Time Format Documentation</a>") | ||||
166 | visible: cfg_dateFormat == "custom" | ||||
167 | wrapMode: Text.Wrap | ||||
168 | QtLayouts.Layout.preferredWidth: QtLayouts.Layout.maximumWidth | ||||
169 | QtLayouts.Layout.maximumWidth: units.gridUnit * 16 | ||||
170 | | ||||
171 | onLinkActivated: Qt.openUrlExternally(link) | ||||
172 | MouseArea { | ||||
173 | anchors.fill: parent | ||||
174 | acceptedButtons: Qt.NoButton // We don't want to eat clicks on the Label | ||||
175 | cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor | ||||
176 | } | ||||
177 | } | ||||
178 | | ||||
153 | Item { | 179 | Item { | ||
154 | Kirigami.FormData.isSection: true | 180 | Kirigami.FormData.isSection: true | ||
155 | } | 181 | } | ||
156 | 182 | | |||
157 | QtLayouts.RowLayout { | 183 | QtLayouts.RowLayout { | ||
158 | QtLayouts.Layout.fillWidth: true | 184 | QtLayouts.Layout.fillWidth: true | ||
159 | 185 | | |||
160 | Kirigami.FormData.label: i18n("Font style:") | 186 | Kirigami.FormData.label: i18n("Font style:") | ||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |
Does this also need a i18nc("custom date format", "Custom") translation context?