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
=== modified file 'MonthComponent.qml'
--- MonthComponent.qml 2016-04-26 19:38:03 +0000
+++ MonthComponent.qml 2016-04-28 13:49:08 +0000
@@ -31,7 +31,6 @@
31 property int currentMonth;31 property int currentMonth;
3232
33 property var isYearView;33 property var isYearView;
34 property var highlightedDate;
35 property bool displayWeekNumber:false34 property bool displayWeekNumber:false
36 property bool displayLunarCalendar: false35 property bool displayLunarCalendar: false
3736
@@ -46,7 +45,6 @@
4645
47 signal monthSelected(var date);46 signal monthSelected(var date);
48 signal dateSelected(var date);47 signal dateSelected(var date);
49 signal dateHighlighted(var date);
5048
51 function updateEvents(events) {49 function updateEvents(events) {
52 intern.eventStatus = events50 intern.eventStatus = events
@@ -83,9 +81,6 @@
83 property int dateFontSize: FontUtils.sizeToPixels(root.dateLabelFontSize)81 property int dateFontSize: FontUtils.sizeToPixels(root.dateLabelFontSize)
84 property int dayFontSize: FontUtils.sizeToPixels(root.dayLabelFontSize)82 property int dayFontSize: FontUtils.sizeToPixels(root.dayLabelFontSize)
8583
86 property int highlightedIndex: root.isCurrentItem &&
87 root.highlightedDate ?
88 intern.indexByDate(root.highlightedDate) : -1
89 property int todayIndex: root.isCurrentItem &&84 property int todayIndex: root.isCurrentItem &&
90 isCurMonthTodayMonth ?85 isCurMonthTodayMonth ?
91 intern.indexByDate(intern.today) : -186 intern.indexByDate(intern.today) : -1
@@ -115,7 +110,7 @@
115 id: todayShape110 id: todayShape
116111
117 visible: (monthGrid.todayItem != null)112 visible: (monthGrid.todayItem != null)
118 color: (monthGrid.highlightedItem === monthGrid.todayItem) ? UbuntuColors.darkGrey : UbuntuColors.orange113 color: UbuntuColors.orange
119 width: parent ? Math.min(parent.height, parent.width) / 1.3 : 0114 width: parent ? Math.min(parent.height, parent.width) / 1.3 : 0
120 height: width115 height: width
121 parent: monthGrid.todayItem116 parent: monthGrid.todayItem
@@ -129,24 +124,6 @@
129 }124 }
130 }125 }
131126
132 UbuntuShape{
133 id: highlightedShape
134
135 visible: monthGrid.highlightedItem && (monthGrid.highlightedItem != monthGrid.todayItem)
136 color: UbuntuColors.darkGrey
137 width: parent ? Math.min(parent.height, parent.width) / 1.3 : 0
138 height: width
139 parent: monthGrid.highlightedItem
140 anchors.centerIn: parent
141 z: -1
142 Rectangle {
143 anchors.fill: parent
144 anchors.margins: units.gu(0.5)
145 color: UbuntuColors.lightGrey
146 radius: 5
147 }
148 }
149
150 Column{127 Column{
151 id: column128 id: column
152129
@@ -213,10 +190,6 @@
213 readonly property var todayItem: (intern.todayIndex != -1) &&190 readonly property var todayItem: (intern.todayIndex != -1) &&
214 (monthGrid.children.length > intern.todayIndex) ?191 (monthGrid.children.length > intern.todayIndex) ?
215 dateLabelRepeater.itemAt(intern.todayIndex) : null192 dateLabelRepeater.itemAt(intern.todayIndex) : null
216 readonly property var highlightedItem: (intern.highlightedIndex != -1) &&
217 (monthGrid.children.length > intern.highlightedIndex) ?
218 dateLabelRepeater.itemAt(intern.highlightedIndex) : null
219
220 anchors {193 anchors {
221 left: parent.left194 left: parent.left
222 right: parent.right195 right: parent.right
@@ -248,11 +221,8 @@
248221
249 onPressAndHold: {222 onPressAndHold: {
250 var dayItem = getItemAt(mouse.x, mouse.y)223 var dayItem = getItemAt(mouse.x, mouse.y)
251224 var selectedDate = new Date(dayItem.delegateDate.getTime());
252 if( dayItem.isSelected ) {225 pageStack.push(Qt.resolvedUrl("NewEvent.qml"), {"date":selectedDate, "model":eventModel});
253 var selectedDate = new Date(dayItem.delegateDate.getTime());
254 pageStack.push(Qt.resolvedUrl("NewEvent.qml"), {"date":selectedDate, "model":eventModel});
255 }
256 }226 }
257 onClicked: {227 onClicked: {
258 var dayItem = getItemAt(mouse.x, mouse.y)228 var dayItem = getItemAt(mouse.x, mouse.y)
@@ -261,12 +231,7 @@
261 //If yearView is clicked then open selected MonthView231 //If yearView is clicked then open selected MonthView
262 root.monthSelected(selectedDate);232 root.monthSelected(selectedDate);
263 } else {233 } else {
264 if (dayItem.isSelected) {234 root.dateSelected(selectedDate);
265 //If monthView is clicked then open selected DayView
266 root.dateSelected(selectedDate);
267 } else {
268 root.dateHighlighted(selectedDate)
269 }
270 }235 }
271 }236 }
272 }237 }
@@ -392,7 +357,6 @@
392 }357 }
393 }358 }
394 isToday: intern.todayDate == date && intern.isCurMonthTodayMonth359 isToday: intern.todayDate == date && intern.isCurMonthTodayMonth
395 isSelected: intern.highlightedIndex == index
396 width: monthGrid.dayWidth360 width: monthGrid.dayWidth
397 height: monthGrid.dayHeight361 height: monthGrid.dayHeight
398 }362 }
@@ -408,7 +372,6 @@
408 isCurrentMonth: delegateDate.getMonth() === root.currentMonth372 isCurrentMonth: delegateDate.getMonth() === root.currentMonth
409373
410 isToday: intern.todayDate == date && intern.isCurMonthTodayMonth374 isToday: intern.todayDate == date && intern.isCurMonthTodayMonth
411 isSelected: intern.highlightedIndex == index
412 width: monthGrid.dayWidth375 width: monthGrid.dayWidth
413 height: monthGrid.dayHeight376 height: monthGrid.dayHeight
414 }377 }
415378
=== modified file 'MonthView.qml'
--- MonthView.qml 2016-03-17 01:51:25 +0000
+++ MonthView.qml 2016-04-28 13:49:08 +0000
@@ -34,13 +34,11 @@
34 readonly property var currentDate: monthViewPath.currentItem.indexDate34 readonly property var currentDate: monthViewPath.currentItem.indexDate
3535
36 property var selectedDay;36 property var selectedDay;
37 property var highlightedDate;
38 property bool displayLunarCalendar: false37 property bool displayLunarCalendar: false
3938
40 signal dateSelected(var date);39 signal dateSelected(var date);
4140
42 Keys.forwardTo: [monthViewPath]41 Keys.forwardTo: [monthViewPath]
43 createEventAt: highlightedDate ? highlightedDate : currentDate
44 onAnchorDateChanged: monthViewPath.scrollToBegginer()42 onAnchorDateChanged: monthViewPath.scrollToBegginer()
4543
46 Action {44 Action {
@@ -106,15 +104,11 @@
106 isCurrentItem: PathView.isCurrentItem104 isCurrentItem: PathView.isCurrentItem
107 isActive: !monthViewPath.moving && !monthViewPath.flicking105 isActive: !monthViewPath.moving && !monthViewPath.flicking
108 displayWeekNumber: mainView.displayWeekNumber106 displayWeekNumber: mainView.displayWeekNumber
109 highlightedDate: monthViewPage.highlightedDate
110 isYearView: false107 isYearView: false
111108
112 onDateSelected: {109 onDateSelected: {
113 monthViewPage.dateSelected(date);110 monthViewPage.dateSelected(date);
114 }111 }
115 onDateHighlighted: {
116 monthViewPage.highlightedDate = date
117 }
118 }112 }
119 }113 }
120}114}
121115
=== modified file 'calendar.qml'
--- calendar.qml 2016-03-23 11:58:58 +0000
+++ calendar.qml 2016-04-28 13:49:08 +0000
@@ -659,13 +659,6 @@
659 tabs.currentDay = currentDate659 tabs.currentDay = currentDate
660 }660 }
661661
662 onHighlightedDateChanged: {
663 if (highlightedDate)
664 tabs.currentDay = highlightedDate
665 else
666 tabs.currentDay = currentDate
667 }
668
669 onDateSelected: {662 onDateSelected: {
670 tabs.currentDay = date663 tabs.currentDay = date
671 tabs.selectedTabIndex = dayTab.index664 tabs.selectedTabIndex = dayTab.index

Subscribers

People subscribed via source and target branches

to status/vote changes: