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

List:       kde-commits
Subject:    [plasma-workspace] applets/digital-clock/package/contents/ui: Add ScrollArea to events view in calen
From:       David Rosca <nowrep () gmail ! com>
Date:       2016-05-25 9:18:01
Message-ID: E1b5Uwz-00049V-9B () scm ! kde ! org
[Download RAW message or body]

Git commit 88d72a4121f889424543f934578391eae36e232e by David Rosca.
Committed on 25/05/2016 at 09:15.
Pushed by drosca into branch 'master'.

Add ScrollArea to events view in calendar

Differential Revision: https://phabricator.kde.org/D1678

M  +43   -38   applets/digital-clock/package/contents/ui/CalendarView.qml

http://commits.kde.org/plasma-workspace/88d72a4121f889424543f934578391eae36e232e

diff --git a/applets/digital-clock/package/contents/ui/CalendarView.qml \
b/applets/digital-clock/package/contents/ui/CalendarView.qml index f915654..c093a5f \
                100644
--- a/applets/digital-clock/package/contents/ui/CalendarView.qml
+++ b/applets/digital-clock/package/contents/ui/CalendarView.qml
@@ -142,64 +142,69 @@ Item {
                              + agenda.dateString(" yyyy")
         }
 
-        ListView {
-            id: holidaysList
+        PlasmaExtras.ScrollArea {
+            id: holidaysView
             anchors {
                 top: dateHeading.bottom
                 left: parent.left
                 right: parent.right
                 bottom: parent.bottom
             }
+            flickableItem.boundsBehavior: Flickable.StopAtBounds
 
-            delegate: Item {
-                id: eventItem
-                width: holidaysList.width
-                height: eventTitle.paintedHeight
-                property bool hasTime: {
-                    var startIsMidnight = modelData.startDateTime.getHours() == 0
-                                       && modelData.startDateTime.getMinutes() == 0;
+            ListView {
+                id: holidaysList
 
-                    var endIsMidnight = modelData.endDateTime.getHours() == 0
-                                     && modelData.endDateTime.getMinutes() == 0;
+                delegate: Item {
+                    id: eventItem
+                    width: holidaysList.width
+                    height: eventTitle.paintedHeight
+                    property bool hasTime: {
+                        var startIsMidnight = modelData.startDateTime.getHours() == \
0 +                                           && modelData.startDateTime.getMinutes() \
== 0;  
-                    var sameDay = modelData.startDateTime.getDate() == \
                modelData.endDateTime.getDate()
-                               && modelData.startDateTime.getDay() == \
modelData.endDateTime.getDay() +                        var endIsMidnight = \
modelData.endDateTime.getHours() == 0 +                                         && \
modelData.endDateTime.getMinutes() == 0;  
-                    if (startIsMidnight && endIsMidnight && sameDay) {
-                        return false
-                    }
+                        var sameDay = modelData.startDateTime.getDate() == \
modelData.endDateTime.getDate() +                                   && \
modelData.startDateTime.getDay() == modelData.endDateTime.getDay()  
-                    return true;
-                }
+                        if (startIsMidnight && endIsMidnight && sameDay) {
+                            return false
+                        }
+
+                        return true;
+                    }
 
-                PlasmaComponents.Label {
-                    text: {
-                        if (modelData.startDateTime - modelData.endDateTime === 0) {
-                            return Qt.formatTime(modelData.startDateTime);
-                        } else {
-                            return Qt.formatTime(modelData.startDateTime) + " - " + \
Qt.formatTime(modelData.endDateTime); +                    PlasmaComponents.Label {
+                        text: {
+                            if (modelData.startDateTime - modelData.endDateTime === \
0) { +                                return Qt.formatTime(modelData.startDateTime);
+                            } else {
+                                return Qt.formatTime(modelData.startDateTime) + " - \
" + Qt.formatTime(modelData.endDateTime); +                            }
                         }
+                        visible: eventItem.hasTime
+                    }
+                    PlasmaComponents.Label {
+                        id: eventTitle
+                        width: eventItem.hasTime ? parent.width * 0.7 : parent.width
+                        anchors.right: parent.right
+                        text: modelData.title
                     }
-                    visible: eventItem.hasTime
-                }
-                PlasmaComponents.Label {
-                    id: eventTitle
-                    width: eventItem.hasTime ? parent.width * 0.7 : parent.width
-                    anchors.right: parent.right
-                    text: modelData.title
                 }
-            }
 
-            section.property: "modelData.eventType"
-            section.delegate: PlasmaExtras.Heading {
-                level: 3
-                elide: Text.ElideRight
-                text: section
+                section.property: "modelData.eventType"
+                section.delegate: PlasmaExtras.Heading {
+                    level: 3
+                    elide: Text.ElideRight
+                    text: section
+                }
             }
         }
 
         PlasmaExtras.Heading {
-            anchors.fill: holidaysList
+            anchors.fill: holidaysView
             anchors.leftMargin: units.largeSpacing
             anchors.rightMargin: units.largeSpacing
             text: monthView.isToday(monthView.currentDate) ? i18n("No events for \
today")


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

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