Merge lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1562657 into lp:ubuntu-calendar-app

Proposed by Arthur Mello
Status: Merged
Approved by: Renato Araujo Oliveira Filho
Approved revision: 830
Merged at revision: 831
Proposed branch: lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1562657
Merge into: lp:ubuntu-calendar-app
Diff against target: 170 lines (+4/-54)
3 files modified
MonthComponent.qml (+4/-41)
MonthView.qml (+0/-6)
calendar.qml (+0/-7)
To merge this branch: bzr merge lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1562657
Reviewer Review Type Date Requested Status
Renato Araujo Oliveira Filho (community) Approve
Jenkins Bot continuous-integration Approve
Review via email: mp+293268@code.launchpad.net

Commit message

At month view open day view after a single click instead of highlighting date

Description of the change

At month view open day view after a single click instead of highlighting date

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

looks good.

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 2016-04-26 19:38:03 +0000
3+++ MonthComponent.qml 2016-04-28 13:49:08 +0000
4@@ -31,7 +31,6 @@
5 property int currentMonth;
6
7 property var isYearView;
8- property var highlightedDate;
9 property bool displayWeekNumber:false
10 property bool displayLunarCalendar: false
11
12@@ -46,7 +45,6 @@
13
14 signal monthSelected(var date);
15 signal dateSelected(var date);
16- signal dateHighlighted(var date);
17
18 function updateEvents(events) {
19 intern.eventStatus = events
20@@ -83,9 +81,6 @@
21 property int dateFontSize: FontUtils.sizeToPixels(root.dateLabelFontSize)
22 property int dayFontSize: FontUtils.sizeToPixels(root.dayLabelFontSize)
23
24- property int highlightedIndex: root.isCurrentItem &&
25- root.highlightedDate ?
26- intern.indexByDate(root.highlightedDate) : -1
27 property int todayIndex: root.isCurrentItem &&
28 isCurMonthTodayMonth ?
29 intern.indexByDate(intern.today) : -1
30@@ -115,7 +110,7 @@
31 id: todayShape
32
33 visible: (monthGrid.todayItem != null)
34- color: (monthGrid.highlightedItem === monthGrid.todayItem) ? UbuntuColors.darkGrey : UbuntuColors.orange
35+ color: UbuntuColors.orange
36 width: parent ? Math.min(parent.height, parent.width) / 1.3 : 0
37 height: width
38 parent: monthGrid.todayItem
39@@ -129,24 +124,6 @@
40 }
41 }
42
43- UbuntuShape{
44- id: highlightedShape
45-
46- visible: monthGrid.highlightedItem && (monthGrid.highlightedItem != monthGrid.todayItem)
47- color: UbuntuColors.darkGrey
48- width: parent ? Math.min(parent.height, parent.width) / 1.3 : 0
49- height: width
50- parent: monthGrid.highlightedItem
51- anchors.centerIn: parent
52- z: -1
53- Rectangle {
54- anchors.fill: parent
55- anchors.margins: units.gu(0.5)
56- color: UbuntuColors.lightGrey
57- radius: 5
58- }
59- }
60-
61 Column{
62 id: column
63
64@@ -213,10 +190,6 @@
65 readonly property var todayItem: (intern.todayIndex != -1) &&
66 (monthGrid.children.length > intern.todayIndex) ?
67 dateLabelRepeater.itemAt(intern.todayIndex) : null
68- readonly property var highlightedItem: (intern.highlightedIndex != -1) &&
69- (monthGrid.children.length > intern.highlightedIndex) ?
70- dateLabelRepeater.itemAt(intern.highlightedIndex) : null
71-
72 anchors {
73 left: parent.left
74 right: parent.right
75@@ -248,11 +221,8 @@
76
77 onPressAndHold: {
78 var dayItem = getItemAt(mouse.x, mouse.y)
79-
80- if( dayItem.isSelected ) {
81- var selectedDate = new Date(dayItem.delegateDate.getTime());
82- pageStack.push(Qt.resolvedUrl("NewEvent.qml"), {"date":selectedDate, "model":eventModel});
83- }
84+ var selectedDate = new Date(dayItem.delegateDate.getTime());
85+ pageStack.push(Qt.resolvedUrl("NewEvent.qml"), {"date":selectedDate, "model":eventModel});
86 }
87 onClicked: {
88 var dayItem = getItemAt(mouse.x, mouse.y)
89@@ -261,12 +231,7 @@
90 //If yearView is clicked then open selected MonthView
91 root.monthSelected(selectedDate);
92 } else {
93- if (dayItem.isSelected) {
94- //If monthView is clicked then open selected DayView
95- root.dateSelected(selectedDate);
96- } else {
97- root.dateHighlighted(selectedDate)
98- }
99+ root.dateSelected(selectedDate);
100 }
101 }
102 }
103@@ -392,7 +357,6 @@
104 }
105 }
106 isToday: intern.todayDate == date && intern.isCurMonthTodayMonth
107- isSelected: intern.highlightedIndex == index
108 width: monthGrid.dayWidth
109 height: monthGrid.dayHeight
110 }
111@@ -408,7 +372,6 @@
112 isCurrentMonth: delegateDate.getMonth() === root.currentMonth
113
114 isToday: intern.todayDate == date && intern.isCurMonthTodayMonth
115- isSelected: intern.highlightedIndex == index
116 width: monthGrid.dayWidth
117 height: monthGrid.dayHeight
118 }
119
120=== modified file 'MonthView.qml'
121--- MonthView.qml 2016-03-17 01:51:25 +0000
122+++ MonthView.qml 2016-04-28 13:49:08 +0000
123@@ -34,13 +34,11 @@
124 readonly property var currentDate: monthViewPath.currentItem.indexDate
125
126 property var selectedDay;
127- property var highlightedDate;
128 property bool displayLunarCalendar: false
129
130 signal dateSelected(var date);
131
132 Keys.forwardTo: [monthViewPath]
133- createEventAt: highlightedDate ? highlightedDate : currentDate
134 onAnchorDateChanged: monthViewPath.scrollToBegginer()
135
136 Action {
137@@ -106,15 +104,11 @@
138 isCurrentItem: PathView.isCurrentItem
139 isActive: !monthViewPath.moving && !monthViewPath.flicking
140 displayWeekNumber: mainView.displayWeekNumber
141- highlightedDate: monthViewPage.highlightedDate
142 isYearView: false
143
144 onDateSelected: {
145 monthViewPage.dateSelected(date);
146 }
147- onDateHighlighted: {
148- monthViewPage.highlightedDate = date
149- }
150 }
151 }
152 }
153
154=== modified file 'calendar.qml'
155--- calendar.qml 2016-03-23 11:58:58 +0000
156+++ calendar.qml 2016-04-28 13:49:08 +0000
157@@ -659,13 +659,6 @@
158 tabs.currentDay = currentDate
159 }
160
161- onHighlightedDateChanged: {
162- if (highlightedDate)
163- tabs.currentDay = highlightedDate
164- else
165- tabs.currentDay = currentDate
166- }
167-
168 onDateSelected: {
169 tabs.currentDay = date
170 tabs.selectedTabIndex = dayTab.index

Subscribers

People subscribed via source and target branches

to status/vote changes: