Git commit 08312b2e340e10d640131c0186e81a0b9f0f2505 by Martin Klapetek. Committed on 21/04/2016 at 03:41. Pushed by mklapetek into branch 'master'. [calendar] Add a mark to days containing an event REVIEW: 127586 M +1 -0 src/declarativeimports/calendar/calendar.cpp M +1 -0 src/declarativeimports/calendar/calendar.h M +4 -0 src/declarativeimports/calendar/daysmodel.cpp M +2 -0 src/declarativeimports/calendar/daysmodel.h M +9 -0 src/declarativeimports/calendar/qml/DayDelegate.qml M +15 -0 src/declarativeimports/calendar/qml/DaysCalendar.qml http://commits.kde.org/plasma-framework/08312b2e340e10d640131c0186e81a0b9f0= f2505 diff --git a/src/declarativeimports/calendar/calendar.cpp b/src/declarative= imports/calendar/calendar.cpp index 0c525b7..790833b 100644 --- a/src/declarativeimports/calendar/calendar.cpp +++ b/src/declarativeimports/calendar/calendar.cpp @@ -1,5 +1,6 @@ /* Copyright (C) 2013 Mark Gaiser + Copyright (C) 2016 Martin Klapetek = This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/declarativeimports/calendar/calendar.h b/src/declarativeim= ports/calendar/calendar.h index 1849ada..e622fc5 100644 --- a/src/declarativeimports/calendar/calendar.h +++ b/src/declarativeimports/calendar/calendar.h @@ -1,5 +1,6 @@ /* Copyright (C) 2013 Mark Gaiser + Copyright (C) 2016 Martin Klapetek = This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/declarativeimports/calendar/daysmodel.cpp b/src/declarativ= eimports/calendar/daysmodel.cpp index bf99874..a5b9a1a 100644 --- a/src/declarativeimports/calendar/daysmodel.cpp +++ b/src/declarativeimports/calendar/daysmodel.cpp @@ -1,5 +1,6 @@ /* Copyright (C) 2013 Mark Gaiser + Copyright (C) 2016 Martin Klapetek = This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,6 +30,7 @@ DaysModel::DaysModel(QObject *parent) : QAbstractListModel(parent), m_pluginsManager(0), + m_lastRequestedEventsStartDate(QDate()), m_agendaNeedsUpdate(false) { QHash roleNames; @@ -112,7 +114,9 @@ void DaysModel::onDataReady(const QMultiHash & { m_eventsData.reserve(m_eventsData.size() + data.size()); m_eventsData +=3D data; + layoutChanged(); + Q_EMIT agendaUpdated(QDate::currentDate()); } = void DaysModel::onEventModified(const CalendarEvents::EventData &data) diff --git a/src/declarativeimports/calendar/daysmodel.h b/src/declarativei= mports/calendar/daysmodel.h index 8ab232e..62b955b 100644 --- a/src/declarativeimports/calendar/daysmodel.h +++ b/src/declarativeimports/calendar/daysmodel.h @@ -1,5 +1,6 @@ /* Copyright (C) 2013 Mark Gaiser + Copyright (C) 2016 Martin Klapetek = This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -73,6 +74,7 @@ private: QDate m_lastRequestedAgendaDate; QList m_eventPlugins; QMultiHash m_eventsData; + QDate m_lastRequestedEventsStartDate; // this is always this+42 days bool m_agendaNeedsUpdate; }; = diff --git a/src/declarativeimports/calendar/qml/DayDelegate.qml b/src/decl= arativeimports/calendar/qml/DayDelegate.qml index 6353827..a770868 100644 --- a/src/declarativeimports/calendar/qml/DayDelegate.qml +++ b/src/declarativeimports/calendar/qml/DayDelegate.qml @@ -101,6 +101,15 @@ MouseArea { z: todayRect.z - 1 } = + Loader { + active: containsEventItems + anchors.bottom: parent.bottom + anchors.right: parent.right + height: parent.height / 3 + width: height + sourceComponent: eventsMarkerComponent + } + Components.Label { id: label anchors { diff --git a/src/declarativeimports/calendar/qml/DaysCalendar.qml b/src/dec= larativeimports/calendar/qml/DaysCalendar.qml index d4b8fe4..0e119d9 100644 --- a/src/declarativeimports/calendar/qml/DaysCalendar.qml +++ b/src/declarativeimports/calendar/qml/DaysCalendar.qml @@ -229,6 +229,21 @@ Item { } } = + PlasmaCore.Svg { + id: calendarSvg + imagePath: "widgets/calendar" + } + + Component { + id: eventsMarkerComponent + + PlasmaCore.SvgItem { + id: eventsMarker + svg: calendarSvg + elementId: "event" + } + } + Connections { target: theme onTextColorChanged: {