Changeset View
Changeset View
Standalone View
Standalone View
applets/digital-clock/package/contents/ui/configCalendar.qml
Show All 13 Lines | |||||
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.0 | ||
22 | import QtQuick.Controls 1.0 as QtControls | 22 | import QtQuick.Controls 2.4 as QtControls | ||
23 | import QtQuick.Layouts 1.0 as QtLayouts | 23 | import QtQuick.Layouts 1.0 as QtLayouts | ||
24 | import org.kde.plasma.calendar 2.0 as PlasmaCalendar | 24 | import org.kde.plasma.calendar 2.0 as PlasmaCalendar | ||
25 | import org.kde.kirigami 2.5 as Kirigami | ||||
25 | 26 | | |||
26 | Item { | 27 | Item { | ||
27 | id: calendarPage | 28 | id: calendarPage | ||
28 | width: childrenRect.width | 29 | width: childrenRect.width | ||
29 | height: childrenRect.height | 30 | height: childrenRect.height | ||
30 | 31 | | |||
31 | signal configurationChanged | 32 | signal configurationChanged | ||
32 | 33 | | |||
33 | property alias cfg_showWeekNumbers: showWeekNumbers.checked | 34 | property alias cfg_showWeekNumbers: showWeekNumbers.checked | ||
34 | 35 | | |||
35 | function saveConfig() | 36 | function saveConfig() | ||
36 | { | 37 | { | ||
37 | plasmoid.configuration.enabledCalendarPlugins = PlasmaCalendar.EventPluginsManager.enabledPlugins; | 38 | plasmoid.configuration.enabledCalendarPlugins = PlasmaCalendar.EventPluginsManager.enabledPlugins; | ||
38 | } | 39 | } | ||
39 | 40 | | |||
40 | QtLayouts.ColumnLayout { | 41 | Kirigami.FormLayout { | ||
41 | anchors.left: parent.left | 42 | anchors { | ||
43 | left: parent.left | ||||
44 | right: parent.right | ||||
45 | } | ||||
46 | | ||||
42 | QtControls.CheckBox { | 47 | QtControls.CheckBox { | ||
43 | id: showWeekNumbers | 48 | id: showWeekNumbers | ||
44 | text: i18n("Show week numbers in Calendar") | 49 | Kirigami.FormData.label: i18n("General:") | ||
50 | text: i18n("Show week numbers") | ||||
45 | } | 51 | } | ||
46 | 52 | | |||
47 | QtControls.GroupBox { | 53 | Item { | ||
48 | QtLayouts.Layout.fillWidth: true | 54 | Kirigami.FormData.isSection: true | ||
49 | title: i18n("Available Calendar Plugins") | 55 | } | ||
50 | flat: true | | |||
51 | 56 | | |||
52 | QtLayouts.ColumnLayout { | 57 | QtLayouts.ColumnLayout { | ||
58 | Kirigami.FormData.label: i18n("Available Plugins:") | ||||
59 | Kirigami.FormData.buddyFor: children[1] // 0 is the Repeater | ||||
60 | | ||||
53 | Repeater { | 61 | Repeater { | ||
54 | id: calendarPluginsRepeater | 62 | id: calendarPluginsRepeater | ||
55 | model: PlasmaCalendar.EventPluginsManager.model | 63 | model: PlasmaCalendar.EventPluginsManager.model | ||
56 | delegate: QtLayouts.RowLayout { | 64 | delegate: QtLayouts.RowLayout { | ||
57 | QtControls.CheckBox { | 65 | QtControls.CheckBox { | ||
58 | text: model.display | 66 | text: model.display | ||
59 | checked: model.checked | 67 | checked: model.checked | ||
60 | onClicked: { | 68 | onClicked: { | ||
61 | //needed for model's setData to be called | 69 | //needed for model's setData to be called | ||
62 | model.checked = checked; | 70 | model.checked = checked; | ||
63 | calendarPage.configurationChanged(); | 71 | calendarPage.configurationChanged(); | ||
64 | } | 72 | } | ||
65 | } | 73 | } | ||
66 | } | 74 | } | ||
67 | } | 75 | } | ||
68 | } | 76 | } | ||
69 | } | 77 | } | ||
70 | } | | |||
71 | 78 | | |||
72 | Component.onCompleted: { | 79 | Component.onCompleted: { | ||
73 | PlasmaCalendar.EventPluginsManager.populateEnabledPluginsList(plasmoid.configuration.enabledCalendarPlugins); | 80 | PlasmaCalendar.EventPluginsManager.populateEnabledPluginsList(plasmoid.configuration.enabledCalendarPlugins); | ||
74 | } | 81 | } | ||
75 | } | 82 | } | ||
76 | 83 | |