Changeset View
Changeset View
Standalone View
Standalone View
applets/calendar/package/contents/ui/configGeneral.qml
Show All 12 Lines | |||||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. | ||
16 | * | 16 | * | ||
17 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/> | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/> | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.0 | 21 | import QtQuick 2.5 | ||
22 | import QtQuick.Controls 1.0 as QtControls | 22 | import QtQuick.Controls 2.5 as QtControls | ||
23 | import QtQuick.Layouts 1.0 as QtLayouts | 23 | import org.kde.kirigami 2.5 as Kirigami | ||
24 | 24 | | |||
25 | Item { | 25 | Kirigami.FormLayout { | ||
26 | id: generalPage | 26 | id: generalPage | ||
27 | 27 | | |||
filipf: trailing space | |||||
28 | width: childrenRect.width | 28 | anchors.left: parent.left | ||
29 | height: childrenRect.height | 29 | anchors.right: parent.right | ||
30 | 30 | | |||
31 | property alias cfg_showWeekNumbers: showWeekNumbers.checked | 31 | property alias cfg_showWeekNumbers: showWeekNumbers.checked | ||
32 | property string cfg_compactDisplay | 32 | property string cfg_compactDisplay | ||
33 | 33 | | |||
34 | QtLayouts.ColumnLayout { | 34 | | ||
35 | anchors.left: parent.left | | |||
36 | QtControls.CheckBox { | 35 | QtControls.CheckBox { | ||
37 | id: showWeekNumbers | 36 | id: showWeekNumbers | ||
38 | text: i18n("Show week numbers in Calendar") | | |||
39 | } | | |||
40 | 37 | | |||
41 | QtLayouts.RowLayout { | 38 | Kirigami.FormData.label: i18n("Calendar version:") | ||
42 | QtControls.Label { | | |||
43 | text: i18nc("What information is shown in the calendar icon", "Icon:") | | |||
44 | } | | |||
45 | 39 | | |||
46 | QtControls.ComboBox { | 40 | text: i18n("Show week numbers") | ||
47 | id: compactDisplayCombo | | |||
48 | QtLayouts.Layout.minimumWidth: units.gridUnit * 7 // horrible default sizing in ComboBox | | |||
49 | model: [{ | | |||
50 | text: i18nc("Show the number of the day (eg. 31) in the icon", "Day in month"), | | |||
51 | value: "d" | | |||
52 | }, { | | |||
53 | text: i18nc("Show the week number (eg. 50) in the icon", "Week number"), | | |||
54 | value: "w" | | |||
55 | }] | | |||
56 | onActivated: { | | |||
57 | cfg_compactDisplay = compactDisplayCombo.model[index].value | | |||
58 | } | 41 | } | ||
59 | 42 | | |||
60 | Component.onCompleted: { | 43 | | ||
61 | for (var i = 0, length = model.length; i < length; ++i) { | 44 | Item { | ||
62 | if (model[i].value === cfg_compactDisplay) { | 45 | Kirigami.FormData.isSection: true | ||
63 | currentIndex = i | | |||
64 | return | | |||
65 | } | | |||
66 | } | | |||
67 | } | | |||
68 | } | 46 | } | ||
47 | | ||||
48 | | ||||
49 | QtControls.RadioButton { | ||||
50 | Kirigami.FormData.label: i18nc("What information is shown in the calendar icon", "Compact version:") | ||||
51 | | ||||
52 | text: i18nc("Show the number of the day (eg. 31) in the icon", "Show day of the month") | ||||
53 | | ||||
54 | checked: cfg_compactDisplay == "d" | ||||
55 | onCheckedChanged: if (checked) cfg_compactDisplay = "d" | ||||
69 | } | 56 | } | ||
57 | QtControls.RadioButton { | ||||
58 | text: i18nc("Show the week number (eg. 50) in the icon", "Show week number") | ||||
59 | | ||||
60 | checked: cfg_compactDisplay == "w" | ||||
61 | onCheckedChanged: if (checked) cfg_compactDisplay = "w" | ||||
70 | } | 62 | } | ||
71 | } | 63 | } | ||
Compact version is maybe a bit vague, but I can't think of anything better honestly. filipf: Compact version is maybe a bit vague, but I can't think of anything better honestly. | |||||
ngraham: Yeah me neither. :/ |
trailing space