Changeset View
Changeset View
Standalone View
Standalone View
applets/digital-clock/package/contents/ui/CalendarView.qml
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 26 | Item { | |||
---|---|---|---|---|---|
42 | 42 | | |||
43 | property alias borderWidth: monthView.borderWidth | 43 | property alias borderWidth: monthView.borderWidth | ||
44 | property alias monthView: monthView | 44 | property alias monthView: monthView | ||
45 | 45 | | |||
46 | property bool debug: false | 46 | property bool debug: false | ||
47 | 47 | | |||
48 | property bool isExpanded: plasmoid.expanded | 48 | property bool isExpanded: plasmoid.expanded | ||
49 | 49 | | |||
50 | onIsExpandedChanged: { | 50 | function onIsExpandedChanged() { | ||
51 | // clear all the selections when the plasmoid is showing/hiding | 51 | // clear all the selections when the plasmoid is showing/hiding | ||
52 | monthView.resetToToday(); | 52 | monthView.resetToToday(); | ||
53 | } | 53 | } | ||
54 | 54 | | |||
55 | // Top-level layout containing: | 55 | // Top-level layout containing: | ||
56 | // - Left column with current date header, calendar, and agenda view | 56 | // - Left column with current date header, calendar, and agenda view | ||
57 | // - Right column with world clocks | 57 | // - Right column with world clocks | ||
58 | RowLayout { | 58 | RowLayout { | ||
▲ Show 20 Lines • Show All 108 Lines • ▼ Show 20 Line(s) | 154 | function dateEquals(date1, date2) { | |||
167 | return values1.every((value, index) => { | 167 | return values1.every((value, index) => { | ||
168 | return (value === values2[index]); | 168 | return (value === values2[index]); | ||
169 | }, false) | 169 | }, false) | ||
170 | } | 170 | } | ||
171 | 171 | | |||
172 | Connections { | 172 | Connections { | ||
173 | target: monthView | 173 | target: monthView | ||
174 | 174 | | |||
175 | onCurrentDateChanged: { | 175 | function onCurrentDateChanged() { | ||
176 | // Apparently this is needed because this is a simple QList being | 176 | // Apparently this is needed because this is a simple QList being | ||
177 | // returned and if the list for the current day has 1 event and the | 177 | // returned and if the list for the current day has 1 event and the | ||
178 | // user clicks some other date which also has 1 event, QML sees the | 178 | // user clicks some other date which also has 1 event, QML sees the | ||
179 | // sizes match and does not update the labels with the content. | 179 | // sizes match and does not update the labels with the content. | ||
180 | // Resetting the model to null first clears it and then correct data | 180 | // Resetting the model to null first clears it and then correct data | ||
181 | // are displayed. | 181 | // are displayed. | ||
182 | holidaysList.model = null; | 182 | holidaysList.model = null; | ||
183 | holidaysList.model = monthView.daysModel.eventsForDate(monthView.currentDate); | 183 | holidaysList.model = monthView.daysModel.eventsForDate(monthView.currentDate); | ||
Show All 9 Lines | 191 | if (agenda.dateEquals(updatedDate, monthView.currentDate)) { | |||
193 | holidaysList.model = monthView.daysModel.eventsForDate(monthView.currentDate); | 193 | holidaysList.model = monthView.daysModel.eventsForDate(monthView.currentDate); | ||
194 | } | 194 | } | ||
195 | } | 195 | } | ||
196 | } | 196 | } | ||
197 | 197 | | |||
198 | Connections { | 198 | Connections { | ||
199 | target: plasmoid.configuration | 199 | target: plasmoid.configuration | ||
200 | 200 | | |||
201 | onEnabledCalendarPluginsChanged: { | 201 | function onEnabledCalendarPluginsChanged() { | ||
202 | PlasmaCalendar.EventPluginsManager.enabledPlugins = plasmoid.configuration.enabledCalendarPlugins; | 202 | PlasmaCalendar.EventPluginsManager.enabledPlugins = plasmoid.configuration.enabledCalendarPlugins; | ||
203 | } | 203 | } | ||
204 | } | 204 | } | ||
205 | 205 | | |||
206 | Binding { | 206 | Binding { | ||
207 | target: plasmoid | 207 | target: plasmoid | ||
208 | property: "hideOnWindowDeactivate" | 208 | property: "hideOnWindowDeactivate" | ||
209 | value: !plasmoid.configuration.pin | 209 | value: !plasmoid.configuration.pin | ||
▲ Show 20 Lines • Show All 289 Lines • Show Last 20 Lines |