diff --git a/src/declarativeimports/calendar/calendar.cpp b/src/declarativeimports/calendar/calendar.cpp index 0c525b79d..790833b8d 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/declarativeimports/calendar/calendar.h index 1849ada32..e622fc546 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/declarativeimports/calendar/daysmodel.cpp index bf9987421..a5b9a1a64 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 += data; + layoutChanged(); + Q_EMIT agendaUpdated(QDate::currentDate()); } void DaysModel::onEventModified(const CalendarEvents::EventData &data) diff --git a/src/declarativeimports/calendar/daysmodel.h b/src/declarativeimports/calendar/daysmodel.h index 8ab232e9d..62b955be2 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/declarativeimports/calendar/qml/DayDelegate.qml index 635382748..a7708687c 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/declarativeimports/calendar/qml/DaysCalendar.qml index d4b8fe4b9..0e119d91d 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: {