Merge lp:~pkunal-parmar/ubuntu-calendar-app/MonthHighlight into lp:ubuntu-calendar-app

Proposed by Kunal Parmar on 2015-05-17
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„ on 2015-06-26
Approved revision: 652
Merged at revision: 680
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/MonthHighlight
Merge into: lp:ubuntu-calendar-app
Diff against target: 134 lines (+52/-18)
2 files modified
MonthComponent.qml (+9/-1)
MonthComponentDateDelegate.qml (+43/-17)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/MonthHighlight
Reviewer Review Type Date Requested Status
Alan Pope 🍺🐧🐱 πŸ¦„ 2015-05-17 Approve on 2015-06-26
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-06-25
Review via email: mp+259323@code.launchpad.net

Commit Message

Resolves #1432640
First tap set the highlight and then react to tap

Description of the Change

Resolves #1432640
First tap set the highlight and then react to tap

To post a comment you must log in.
Kunal Parmar (pkunal-parmar) wrote :

We need proper UI design for this

What should happen if cell is both selected and today, how should highlight look.

This results in some odd highlights in the year view.

http://i.imgur.com/FAfLe7R.png

review: Needs Fixing
Nicholas Skaggs (nskaggs) wrote :

Note you will need to update the test if you plan on changing how tapping a month in yearview will operate.

646. By Kunal Parmar on 2015-05-30

design improvement

647. By Kunal Parmar on 2015-05-30

Long press on selected item only

648. By Kunal Parmar on 2015-05-30

AP fix

649. By Kunal Parmar on 2015-06-11

dynamic width for highlight

650. By Kunal Parmar on 2015-06-11

merge from trunk

Thanks kunal.

Two more issues.

Swipe between months, I'd expect no day to be hi-lighted, but the 1st of the month always is.
Sometimes I can trigger a situation where a day is hi-lighted with grey box _and_ has orange in-fill... *and* today is highlighted in orange too. Not quite sure how to trigger it, but managed to a couple of times with a bit of excessive swiping.

review: Needs Fixing
651. By Kunal Parmar on 2015-06-11

merge from trunk

652. By Kunal Parmar on 2015-06-11

review comment

Kunal Parmar (pkunal-parmar) wrote :

> Thanks kunal.
>
> Two more issues.
>
> Swipe between months, I'd expect no day to be hi-lighted, but the 1st of the
> month always is.
> Sometimes I can trigger a situation where a day is hi-lighted with grey box
> _and_ has orange in-fill... *and* today is highlighted in orange too. Not
> quite sure how to trigger it, but managed to a couple of times with a bit of
> excessive swiping.

Thanks, Modified code, please have another look

Great! Thanks Kunal.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MonthComponent.qml'
2--- MonthComponent.qml 2015-06-09 10:45:01 +0000
3+++ MonthComponent.qml 2015-06-25 11:59:14 +0000
4@@ -111,6 +111,12 @@
5
6 property int dateFontSize: FontUtils.sizeToPixels(root.dateLabelFontSize)
7 property int dayFontSize: FontUtils.sizeToPixels(root.dayLabelFontSize)
8+
9+ property int selectedIndex: -1
10+ }
11+
12+ onCurrentMonthChanged: {
13+ intern.selectedIndex = -1
14 }
15
16 Column{
17@@ -216,10 +222,12 @@
18
19 isToday: intern.todayDate == date && intern.isCurMonthTodayMonth
20
21+ isSelected: showEvents && intern.selectedIndex == index
22+
23 width: parent.dayWidth
24 height: parent.dayHeight
25 fontSize: intern.dateFontSize
26- showEvent : showEvents
27+ showEvent: showEvents
28 && intern.eventStatus !== undefined
29 && intern.eventStatus[index] !== undefined
30 && intern.eventStatus[index]
31
32=== modified file 'MonthComponentDateDelegate.qml'
33--- MonthComponentDateDelegate.qml 2015-05-14 14:07:00 +0000
34+++ MonthComponentDateDelegate.qml 2015-06-25 11:59:14 +0000
35@@ -10,10 +10,15 @@
36 property bool showEvent;
37 property alias fontSize: dateLabel.font.pixelSize
38
39+ property bool isSelected: false
40+
41 Loader {
42- sourceComponent: isToday && isCurrentMonth ? highLightComp : undefined
43+ sourceComponent: (isToday && isCurrentMonth) || isSelected ? highLightComp : undefined
44 onSourceComponentChanged: {
45- width = Qt.binding( function() { return ( dateRootItem.height / 1.5 ); });
46+ width = Qt.binding( function() {
47+ var width = dateRootItem.height > dateRootItem.width ? dateRootItem.width :dateRootItem.height
48+ return ( width / 1.1 );
49+ });
50 height = Qt.binding ( function() { return width} );
51 anchors.centerIn = Qt.binding( function() { return dateLabel});
52 }
53@@ -26,13 +31,17 @@
54 fontSize: root.dateLabelFontSize
55 color: {
56 if( isCurrentMonth ) {
57- if(isToday) {
58+ if( isToday || isSelected ) {
59 "white"
60 } else {
61 "#5D5D5D"
62 }
63 } else {
64- "#AEA79F"
65+ if(isSelected) {
66+ "white"
67+ } else {
68+ "#AEA79F"
69+ }
70 }
71 }
72 }
73@@ -58,31 +67,48 @@
74 Component{
75 id: highLightComp
76 UbuntuShape{
77- color: "#DD4814"
78+ color: {
79+ if( isToday && !isSelected ) {
80+ "#DD4814"
81+ } else {
82+ "gray"
83+ }
84+ }
85+
86+ Rectangle{
87+ anchors.fill: parent
88+ anchors.margins: units.gu(0.5)
89+ color: isToday ? "#DD4814" : "darkgray"
90+ }
91 }
92 }
93
94 MouseArea {
95 anchors.fill: parent
96 onPressAndHold: {
97- var selectedDate = new Date();
98- selectedDate.setFullYear(intern.monthStartYear)
99- selectedDate.setMonth(intern.monthStartMonth + 1)
100- selectedDate.setDate(date)
101- selectedDate.setMinutes(60, 0, 0)
102- pageStack.push(Qt.resolvedUrl("NewEvent.qml"), {"date":selectedDate, "model":eventModel});
103+ if( isSelected ) {
104+ var selectedDate = new Date();
105+ selectedDate.setFullYear(intern.monthStartYear)
106+ selectedDate.setMonth(intern.monthStartMonth + 1)
107+ selectedDate.setDate(date)
108+ selectedDate.setMinutes(60, 0, 0)
109+ pageStack.push(Qt.resolvedUrl("NewEvent.qml"), {"date":selectedDate, "model":eventModel});
110+ }
111 }
112 onClicked: {
113 var selectedDate = new Date(intern.monthStartYear,
114 intern.monthStartMonth,
115 intern.monthStartDate + index, 0, 0, 0, 0)
116- //If monthView is clicked then open selected DayView
117- if ( isYearView === false ) {
118- root.dateSelected(selectedDate);
119- }
120- //If yearView is clicked then open selected MonthView
121- else {
122+ if( isYearView ) {
123+ //If yearView is clicked then open selected MonthView
124 root.monthSelected(selectedDate);
125+ } else {
126+ if( isSelected ) {
127+ //If monthView is clicked then open selected DayView
128+ root.dateSelected(selectedDate);
129+ } else {
130+ intern.selectedIndex = index
131+ }
132 }
133 }
134 }

Subscribers

People subscribed via source and target branches

to status/vote changes: