[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [plasma-framework] src/declarativeimports/calendar: [calendar] Add a mark to days containing an even
From:       Martin Klapetek <mklapetek () kde ! org>
Date:       2016-04-21 3:41:31
Message-ID: E1at5Uh-0007fR-4o () scm ! kde ! org
[Download RAW message or body]

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/08312b2e340e10d640131c0186e81a0b9f0f2505

diff --git a/src/declarativeimports/calendar/calendar.cpp \
b/src/declarativeimports/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 <markg85@gmail.com>
+    Copyright (C) 2016 Martin Klapetek <mklapetek@kde.org>
 
     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 1849ada..e622fc5 100644
--- a/src/declarativeimports/calendar/calendar.h
+++ b/src/declarativeimports/calendar/calendar.h
@@ -1,5 +1,6 @@
 /*
     Copyright (C) 2013 Mark Gaiser <markg85@gmail.com>
+    Copyright (C) 2016 Martin Klapetek <mklapetek@kde.org>
 
     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 bf99874..a5b9a1a 100644
--- a/src/declarativeimports/calendar/daysmodel.cpp
+++ b/src/declarativeimports/calendar/daysmodel.cpp
@@ -1,5 +1,6 @@
 /*
     Copyright (C) 2013 Mark Gaiser <markg85@gmail.com>
+    Copyright (C) 2016 Martin Klapetek <mklapetek@kde.org>
 
     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<int, QByteArray> roleNames;
@@ -112,7 +114,9 @@ void DaysModel::onDataReady(const QMultiHash<QDate, \
CalendarEvents::EventData> &  {
     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 8ab232e..62b955b 100644
--- a/src/declarativeimports/calendar/daysmodel.h
+++ b/src/declarativeimports/calendar/daysmodel.h
@@ -1,5 +1,6 @@
 /*
     Copyright (C) 2013 Mark Gaiser <markg85@gmail.com>
+    Copyright (C) 2016 Martin Klapetek <mklapetek@kde.org>
 
     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<CalendarEvents::CalendarEventsPlugin*> m_eventPlugins;
     QMultiHash<QDate, CalendarEvents::EventData> 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 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/declarativeimports/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: {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic