← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1563316 into lp:ubuntu-calendar-app

 

Arthur Mello has proposed merging lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1563316 into lp:ubuntu-calendar-app.

Commit message:
Change Event Bubble style depending if user is attending the event following design spec

Requested reviews:
  Ubuntu Calendar Developers (ubuntu-calendar-dev)
Related bugs:
  Bug #1563316 in Ubuntu Calendar App: "Calendar should change event bubble depending of user attendee status"
  https://bugs.launchpad.net/ubuntu-calendar-app/+bug/1563316

For more details, see:
https://code.launchpad.net/~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1563316/+merge/290317

Change Event Bubble style depending if user is attending the event following design spec

Testing
=======
Import from google account events with different attendee status (Yes/Maybe/No) both for future and past end times. Make sure that the event bubble is updated as expected
-- 
Your team Ubuntu Calendar Developers is requested to review the proposed merge of lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1563316 into lp:ubuntu-calendar-app.
=== modified file 'EventBubble.qml'
--- EventBubble.qml	2016-03-28 18:14:09 +0000
+++ EventBubble.qml	2016-03-29 13:30:31 +0000
@@ -38,7 +38,13 @@
     property Flickable flickable;
     property bool isEventBubble: true
     property real minimumHeight: units.gu(4)
+
+    // Event bubble style
+    property alias titleText: eventTitle.text
+    property alias titleColor: eventTitle.color
     property alias strikeoutTitle: eventTitle.font.strikeout
+    property alias backgroundColor: bg.color
+    property alias backgroundOpacity: bg.opacity
 
     readonly property bool isSingleLine: (infoBubble.height < (minimumHeight * 2))
     readonly property real startTimeInMinutes: event ? CanlendarCanvas.minutesSince(infoBubble.anchorDate, event.startDateTime) : 0.0
@@ -52,10 +58,10 @@
     Connections {
         target: model
         ignoreUnknownSignals: true
-        onCollectionsChanged: assignBgColor()
+        onCollectionsChanged: updateEventBubbleStyle()
     }
 
-    function assignBgColor() {
+    function updateEventBubbleStyle() {
         if (model && event ) {
             var collection = model.collection( event.collectionId );
             var now = new Date();
@@ -64,15 +70,32 @@
                 endDateTime = event.startDateTime;
             }
 
+            updateTitle()
+
+            //Accepted events: Solid collection color with white text.
+            infoBubble.backgroundColor = collection.color
+            infoBubble.backgroundOpacity = 1
+            infoBubble.titleColor = "white";
+            infoBubble.strikeoutTitle = false;
+
             if( endDateTime >= now) {
-                bg.color = collection.color
-
-                if( getOwnersStatus(collection) === EventAttendee.StatusDeclined ) {
+                if (getOwnersStatus(collection) === EventAttendee.StatusDeclined) {
+                    // Declined events: As per accepted events with strike-through text.
                     infoBubble.strikeoutTitle = true;
+
+                } else if (getOwnersStatus(collection) === EventAttendee.StatusTentative) {
+                    //Maybe events: As per accepted events with ‘(?)’ placed before Event Title.
+                    infoBubble.titleText = "(?) " + infoBubble.titleText
+
+                } else if (getOwnersStatus(collection) !== EventAttendee.StatusAccepted) {
+                    //Unresponded events: Accepted event colours inverted (i.e. collection color text/ outline on white background).
+                    infoBubble.backgroundColor = "white"
+                    infoBubble.titleColor = collection.color;
+
                 }
             } else {
-                //if event is on past then add some white color to original color
-                bg.color = Qt.tint( collection.color, "#aaffffff" );
+                // Past events: As per accepted events, but at 50% transparency.
+                infoBubble.backgroundOpacity = 0.50
             }
         }
     }
@@ -106,12 +129,12 @@
 
             //there is space for two lines
             if (infoBubble.isSingleLine) {
-                eventTitle.text =  ("%1 %2").arg(timeString).arg(event.displayLabel);
+                infoBubble.titleText =  ("%1 %2").arg(timeString).arg(event.displayLabel);
             } else {
-                eventTitle.text =  ("%1\n%2").arg(timeString).arg(event.displayLabel);
+                infoBubble.titleText =  ("%1\n%2").arg(timeString).arg(event.displayLabel);
             }
         } else {
-            eventTitle.text = event.displayLabel
+            infoBubble.titleText = event.displayLabel
         }
     }
 
@@ -124,10 +147,9 @@
         height = Math.max(minimumHeight, durationInMinutes * parent.minuteHeight)
     }
 
-    onIsSingleLineChanged: updateTitle()
+    onIsSingleLineChanged: updateEventBubbleStyle()
     onEventChanged: {
-        assignBgColor()
-        updateTitle()
+        updateEventBubbleStyle()
         resize()
     }
 
@@ -158,7 +180,6 @@
         }
         clip: true
         fontSize: "small"
-        color: "White"
         font.bold: true
     }
 

=== modified file 'TimeLineBaseComponent.qml'
--- TimeLineBaseComponent.qml	2016-03-22 13:52:25 +0000
+++ TimeLineBaseComponent.qml	2016-03-29 13:30:31 +0000
@@ -347,7 +347,7 @@
                                 onPositionChanged: {
                                     dropArea.modifyEventForDrag(drag)
                                     var eventBubble = drag.source;
-                                    eventBubble.assignBgColor();
+                                    eventBubble.updateEventBubbleStyle();
 
                                     if( eventBubble.y + eventBubble.height + units.gu(8) > timeLineView.contentY + timeLineView.height ) {
                                         var diff = Math.abs((eventBubble.y + eventBubble.height + units.gu(8))  -


Follow ups