← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekViewHighlight into lp:ubuntu-calendar-app

 

Kunal Parmar has proposed merging lp:~pkunal-parmar/ubuntu-calendar-app/WeekViewHighlight into lp:ubuntu-calendar-app.

Requested reviews:
  Ubuntu Calendar Developers (ubuntu-calendar-dev)

For more details, see:
https://code.launchpad.net/~pkunal-parmar/ubuntu-calendar-app/WeekViewHighlight/+merge/259111

WeekView highlight day before moving to day view
-- 
Your team Ubuntu Calendar Developers is requested to review the proposed merge of lp:~pkunal-parmar/ubuntu-calendar-app/WeekViewHighlight into lp:ubuntu-calendar-app.
=== modified file 'EventListModel.qml'
--- EventListModel.qml	2014-09-28 05:25:31 +0000
+++ EventListModel.qml	2015-05-14 13:04:44 +0000
@@ -69,6 +69,7 @@
         var collections = eventModel.collections;
         for(var i = 0 ; i < collections.length ; ++i) {
             var cal = collections[i];
+            //print(cal.name + " ---- " + cal.extendedMetaData("collection-readonly"));
             if( cal.extendedMetaData("collection-type") === "Calendar" ) {
                 cals.push(cal);
             }

=== modified file 'HeaderDateComponent.qml'
--- HeaderDateComponent.qml	2015-03-21 16:15:53 +0000
+++ HeaderDateComponent.qml	2015-05-14 13:04:44 +0000
@@ -34,9 +34,20 @@
     // Signal fired when pressing on the date
     signal dateSelected(var date)
 
+    property bool highlighted: false
+
     width: dayLabel.paintedWidth
     height: dateContainer.height
 
+    Rectangle{
+        id: background
+        color: "transparent"
+        visible: highlighted
+        anchors.fill: parent
+        border.width: units.gu(0.3)
+        border.color: UbuntuColors.orange
+    }
+
     Column {
         id: dateContainer
         objectName: "dateContainer"

=== modified file 'TimeLineHeaderComponent.qml'
--- TimeLineHeaderComponent.qml	2014-11-29 05:15:13 +0000
+++ TimeLineHeaderComponent.qml	2015-05-14 13:04:44 +0000
@@ -30,6 +30,8 @@
     property bool isCurrentItem: false
     property var currentDay
 
+    property int highlightedIndex;
+
     signal dateSelected(var date);
 
     width: parent.width
@@ -41,9 +43,11 @@
         delegate: HeaderDateComponent{
             date: type == ViewType.ViewTypeWeek ? startDay.addDays(index) : startDay
             dayFormat: Locale.ShortFormat
+            highlighted: (type == ViewType.ViewTypeWeek) && (highlightedIndex == index)
 
             dayColor: {
                 if( type == ViewType.ViewTypeWeek && date.isSameDay(DateExt.today())){
+                    highlightedIndex = index
                     UbuntuColors.orange
                 } /*else if( type == ViewType.ViewTypeDay && date.isSameDay(currentDay) ) {
                     UbuntuColors.orange
@@ -56,7 +60,15 @@
             height: header.height
 
             onDateSelected: {
-                header.dateSelected(date);
+                if( type == ViewType.ViewTypeDay ){
+                    header.dateSelected(date);
+                } else {
+                    if(highlighted) {
+                        header.dateSelected(date);
+                    } else {
+                        header.highlightedIndex = index
+                    }
+                }
             }
 
             Loader{


Follow ups