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

Proposed by Kunal Parmar
Status: Merged
Approved by: Mihir Soni
Approved revision: 194
Merged at revision: 239
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/Key_Navi
Merge into: lp:ubuntu-calendar-app
Diff against target: 337 lines (+152/-23)
9 files modified
DayView.qml (+2/-0)
EventDetails.qml (+27/-15)
MonthView.qml (+2/-0)
NewEvent.qml (+4/-0)
PathViewBase.qml (+24/-0)
TimeLineBaseComponent.qml (+33/-3)
WeekView.qml (+2/-1)
YearView.qml (+33/-0)
calendar.qml (+25/-4)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/Key_Navi
Reviewer Review Type Date Requested Status
Mihir Soni Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+203201@code.launchpad.net

Commit message

Keyboard navigation implemented

Description of the change

Keyboard navigation implemented
Tab navigation implemented, (CTRL + TAB) to switch
In Year, Day, Week, Month View -> Left/Right arrow to go to next or previous item
In Year, Day, Week, Month View -> Up/(Down| Space) to scroll up or down
In Details View - Escape to go back, CTRL + E to Edit
In Add Event - Escape to go back

To post a comment you must log in.
186. By Kunal Parmar

Edit event using key resolved

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

There seems to be an odd skip in the year view. It goes January -> March then leaps to September when you press down arrow.

Also, can we add CTRL+SHIFT+TAB to go backwards to match CTRL+TAB going forwards in tabs?

187. By Kunal Parmar

YearView jump resolved and backtab implemented

188. By Kunal Parmar

Merge from trunk

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> There seems to be an odd skip in the year view. It goes January -> March then
> leaps to September when you press down arrow.
>
> Also, can we add CTRL+SHIFT+TAB to go backwards to match CTRL+TAB going
> forwards in tabs?

This two things I addressed, please check again if you find something missing

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ybon (yohanboniface) wrote :

So, I've set up my env, and been able to test.
Every binding anounced is working for me (including Ctrl-Shift-TAB) :)

One question I can't answer myself: til wich point we want to have key bindings? For example, does Ctrl-S for save when in edit view, Ctrl-N for New from everywhere (unless edit view) make sense? Return for saving when in a textitem? Echap to close a TimePicker?

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> So, I've set up my env, and been able to test.
> Every binding anounced is working for me (including Ctrl-Shift-TAB) :)
>
> One question I can't answer myself: til wich point we want to have key
> bindings? For example, does Ctrl-S for save when in edit view, Ctrl-N for New
> from everywhere (unless edit view) make sense? Return for saving when in a
> textitem? Echap to close a TimePicker?

In this MR I have not addressed keyboard/Mouse handling required for NewEvent.qml component,
we need to consider Tab key and shortcuts you mentioned.
We also need to make sure key and mouse is properly handled in DatePicker/TimePicker and OptionSelectors.

I think its better to handle it in another MR, once we have Date/Time picker available and integrated.

189. By Kunal Parmar

Merge from trunk

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
190. By Kunal Parmar

Merge from trunk

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
191. By Kunal Parmar

Merge from trunk

192. By Kunal Parmar

Merge issue resolved

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Martin Borho (martin-borho) wrote :

+1

Looks okay for me.

Revision history for this message
Roman Shchekin (mrqtros) wrote :

This line looks strange:
Keys.forwardTo: [yearView,monthView,weekView,dayView,pageStack.currentPage,tabPage]
because of using "pageStack.currentPage". Is it necessary?

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> This line looks strange:
> Keys.forwardTo:
> [yearView,monthView,weekView,dayView,pageStack.currentPage,tabPage]
> because of using "pageStack.currentPage". Is it necessary?

I agree, that should be enought, I will change

Revision history for this message
Mihir Soni (mihirsoni) wrote :

Works great , i just tested it.
Once you push last changes will make status approved for continuous integration.

Thank you.

review: Approve
Revision history for this message
Mihir Soni (mihirsoni) wrote :

> > This line looks strange:
> > Keys.forwardTo:
> > [yearView,monthView,weekView,dayView,pageStack.currentPage,tabPage]
> > because of using "pageStack.currentPage". Is it necessary?
>
> I agree, that should be enought, I will change

Could you please push this small change , then we can merge this MR.

193. By Kunal Parmar

Merge from Trunk

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> > This line looks strange:
> > Keys.forwardTo:
> > [yearView,monthView,weekView,dayView,pageStack.currentPage,tabPage]
> > because of using "pageStack.currentPage". Is it necessary?
>
> I agree, that should be enought, I will change

Somehow if keys are not forwarded to individual views then they are not getting key events.

I am refacroring the cal app and planning to load only one view at a time.
I will handle this properly there. as I need to change this code anyhow that time

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
194. By Kunal Parmar

merge from trunk

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Mihir Soni (mihirsoni) wrote :

Looks good.

Thanks you Kunal.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'DayView.qml'
--- DayView.qml 2014-03-26 14:39:17 +0000
+++ DayView.qml 2014-04-08 08:59:31 +0000
@@ -11,6 +11,8 @@
11 property var currentDay: new Date()11 property var currentDay: new Date()
12 property bool isCurrentPage: false12 property bool isCurrentPage: false
1313
14 Keys.forwardTo: [dayViewPath]
15
14 Column {16 Column {
15 id: column17 id: column
16 anchors.top: parent.top18 anchors.top: parent.top
1719
=== modified file 'EventDetails.qml'
--- EventDetails.qml 2014-04-05 06:31:50 +0000
+++ EventDetails.qml 2014-04-08 08:59:31 +0000
@@ -95,8 +95,17 @@
95 }95 }
96 }96 }
9797
98 Keys.onEscapePressed: {
99 pageStack.pop();
100 }
101
102 Keys.onPressed: {
103 if ((event.key === Qt.Key_E) && ( event.modifiers & Qt.ControlModifier)) {
104 pageStack.push(Qt.resolvedUrl("NewEvent.qml"),{"event": root.event});
105 }
106 }
107
98 tools: ToolbarItems {108 tools: ToolbarItems {
99
100 ToolbarButton {109 ToolbarButton {
101 action:Action {110 action:Action {
102 text: i18n.tr("Delete");111 text: i18n.tr("Delete");
@@ -214,28 +223,31 @@
214 font.bold: true223 font.bold: true
215 }224 }
216 //Guest Entery Model starts225 //Guest Entery Model starts
217 ListView {226 Column{
218 id:contactList227 id: contactList
219 spacing: units.gu(1)228 spacing: units.gu(1)
220 width: parent.width229 width: parent.width
221 height: units.gu((contactModel.count*4.5)+3)
222 clip: true230 clip: true
223 model: ListModel {231 ListModel {
224 id: contactModel232 id: contactModel
225 }233 }
226 delegate: Row{234 Repeater{
227 spacing: units.gu(1)235 model: contactModel
228 CheckBox{236 delegate: Row{
229 checked: participationStatus237 spacing: units.gu(1)
230 enabled: false238 CheckBox{
231 }239 checked: participationStatus
232 Label {240 enabled: false
233 text:name241 }
234 anchors.verticalCenter: parent.verticalCenter242 Label {
235 color: detailColor243 text:name
244 anchors.verticalCenter: parent.verticalCenter
245 color: detailColor
246 }
236 }247 }
237 }248 }
238 }249 }
250
239 //Guest Entries ends251 //Guest Entries ends
240 ThinDivider{}252 ThinDivider{}
241 property int recurranceAreaMaxWidth: Math.max( recurrentHeader.headerWidth, reminderHeader.headerWidth) //Dynamic Height253 property int recurranceAreaMaxWidth: Math.max( recurrentHeader.headerWidth, reminderHeader.headerWidth) //Dynamic Height
242254
=== modified file 'MonthView.qml'
--- MonthView.qml 2014-03-22 03:09:07 +0000
+++ MonthView.qml 2014-04-08 08:59:31 +0000
@@ -11,6 +11,8 @@
1111
12 signal dateSelected(var date);12 signal dateSelected(var date);
1313
14 Keys.forwardTo: [monthViewPath]
15
14 PathViewBase{16 PathViewBase{
15 id: monthViewPath17 id: monthViewPath
1618
1719
=== modified file 'NewEvent.qml'
--- NewEvent.qml 2014-04-05 04:49:47 +0000
+++ NewEvent.qml 2014-04-08 08:59:31 +0000
@@ -177,6 +177,10 @@
177177
178 title: isEdit ? i18n.tr("Edit Event"):i18n.tr("New Event")178 title: isEdit ? i18n.tr("Edit Event"):i18n.tr("New Event")
179179
180 Keys.onEscapePressed: {
181 pageStack.pop();
182 }
183
180 tools: ToolbarItems {184 tools: ToolbarItems {
181 //keeping toolbar always open185 //keeping toolbar always open
182 opened: true186 opened: true
183187
=== modified file 'PathViewBase.qml'
--- PathViewBase.qml 2013-12-14 02:44:09 +0000
+++ PathViewBase.qml 2014-04-08 08:59:31 +0000
@@ -9,6 +9,9 @@
9 signal nextItemHighlighted();9 signal nextItemHighlighted();
10 signal previousItemHighlighted();10 signal previousItemHighlighted();
1111
12 signal scrollUp();
13 signal scrollDown();
14
12 preferredHighlightBegin: 0.515 preferredHighlightBegin: 0.5
13 preferredHighlightEnd: 0.516 preferredHighlightEnd: 0.5
1417
@@ -31,8 +34,29 @@
31 return 1;34 return 1;
32 }35 }
3336
37 Keys.onLeftPressed:{
38 root.decrementCurrentIndex();
39 }
40
41 Keys.onRightPressed:{
42 root.incrementCurrentIndex();
43 }
44
45 Keys.onSpacePressed: {
46 root.scrollDown();
47 }
48
49 Keys.onDownPressed: {
50 root.scrollDown();
51 }
52
53 Keys.onUpPressed: {
54 root.scrollUp();
55 }
56
34 onCurrentIndexChanged: {57 onCurrentIndexChanged: {
35 var diff = currentIndex - intern.previousIndex58 var diff = currentIndex - intern.previousIndex
59 if(diff == 0) return;
3660
37 if (intern.previousIndex === count - 1 && currentIndex === 0) diff = 161 if (intern.previousIndex === count - 1 && currentIndex === 0) diff = 1
38 if (intern.previousIndex === 0 && currentIndex === count - 1) diff = -162 if (intern.previousIndex === 0 && currentIndex === count - 1) diff = -1
3963
=== modified file 'TimeLineBaseComponent.qml'
--- TimeLineBaseComponent.qml 2014-04-05 04:49:47 +0000
+++ TimeLineBaseComponent.qml 2014-04-08 08:59:31 +0000
@@ -15,13 +15,43 @@
1515
16 property int type: ViewType.ViewTypeWeek16 property int type: ViewType.ViewTypeWeek
1717
18 //visible hour
19 property int scrollHour;
20
18 function scrollToCurrentTime() {21 function scrollToCurrentTime() {
19 //scroll to current time22 //scroll to current time
20 var currentTime = new Date();23 var currentTime = new Date();
21 //TODO: if current time is early morning should we show time from 9 am ?24 //TODO: if current time is early morning should we show time from 9 am ?
22 var hour = currentTime.getHours();25 scrollHour = currentTime.getHours();
2326
24 timeLineView.contentY = hour * units.gu(10);27 timeLineView.contentY = scrollHour * units.gu(10);
28 if(timeLineView.contentY >= timeLineView.contentHeight - timeLineView.height) {
29 timeLineView.contentY = timeLineView.contentHeight - timeLineView.height
30 }
31 }
32
33 Connections{
34 target: parent
35 onScrollUp:{
36 scrollHour--;
37 if( scrollHour < 0) {
38 scrollHour =0;
39 }
40 scrollToHour();
41 }
42
43 onScrollDown:{
44 scrollHour++;
45 var visibleHour = root.height / units.gu(10);
46 if( scrollHour > (25 -visibleHour)) {
47 scrollHour = 25 - visibleHour;
48 }
49 scrollToHour();
50 }
51 }
52
53 function scrollToHour() {
54 timeLineView.contentY = scrollHour * units.gu(10);
25 if(timeLineView.contentY >= timeLineView.contentHeight - timeLineView.height) {55 if(timeLineView.contentY >= timeLineView.contentHeight - timeLineView.height) {
26 timeLineView.contentY = timeLineView.contentHeight - timeLineView.height56 timeLineView.contentY = timeLineView.contentHeight - timeLineView.height
27 }57 }
2858
=== modified file 'WeekView.qml'
--- WeekView.qml 2014-04-05 04:57:34 +0000
+++ WeekView.qml 2014-04-08 08:59:31 +0000
@@ -19,6 +19,8 @@
19 anchors.topMargin: units.gu(1.5)19 anchors.topMargin: units.gu(1.5)
20 spacing: units.gu(1)20 spacing: units.gu(1)
2121
22 Keys.forwardTo: [weekViewPath]
23
22 ViewHeader{24 ViewHeader{
23 id: viewHeader25 id: viewHeader
24 month: dayStart.getMonth()26 month: dayStart.getMonth()
@@ -65,7 +67,6 @@
6567
66 delegate: TimeLineBaseComponent {68 delegate: TimeLineBaseComponent {
67 id: timeLineView69 id: timeLineView
68
69 type: ViewType.ViewTypeWeek70 type: ViewType.ViewTypeWeek
7071
71 width: parent.width72 width: parent.width
7273
=== modified file 'YearView.qml'
--- YearView.qml 2014-04-04 02:14:33 +0000
+++ YearView.qml 2014-04-08 08:59:31 +0000
@@ -25,6 +25,7 @@
25 clip: true25 clip: true
26 focus: index == root.currentIndex26 focus: index == root.currentIndex
2727
28 property int scrollMonth: 0;
28 property bool isCurrentItem: index == root.currentIndex29 property bool isCurrentItem: index == root.currentIndex
29 property int year: (root.currentYear + root.indexType(index))30 property int year: (root.currentYear + root.indexType(index))
3031
@@ -39,6 +40,38 @@
39 cellHeight: cellWidth * 1.440 cellHeight: cellWidth * 1.4
4041
41 model: 12 /* months in a year */42 model: 12 /* months in a year */
43
44 onYearChanged : {
45 scrollMonth=0;
46 yearView.positionViewAtIndex(scrollMonth,GridView.Beginning);
47 }
48
49 //scroll in case content height changed
50 onHeightChanged: {
51 scrollMonth=0;
52 yearView.positionViewAtIndex(scrollMonth,GridView.Beginning);
53 }
54
55 Connections{
56 target: root
57 onScrollUp:{
58 scrollMonth -= 2;
59 if(scrollMonth < 0) {
60 scrollMonth = 0;
61 }
62 yearView.positionViewAtIndex(scrollMonth,GridView.Beginning);
63 }
64
65 onScrollDown:{
66 scrollMonth += 2;
67 var visibleMonths = yearView.height / cellHeight;
68 if( scrollMonth >= (11 - visibleMonths)) {
69 scrollMonth = (11 - visibleMonths);
70 }
71 yearView.positionViewAtIndex(scrollMonth,GridView.Beginning);
72 }
73 }
74
42 delegate: Item {75 delegate: Item {
43 width: yearView.cellWidth76 width: yearView.cellWidth
44 height: yearView.cellHeight77 height: yearView.cellHeight
4578
=== modified file 'calendar.qml'
--- calendar.qml 2014-04-05 06:34:47 +0000
+++ calendar.qml 2014-04-08 08:59:31 +0000
@@ -52,6 +52,8 @@
5252
53 width: units.gu(100)53 width: units.gu(100)
54 height: units.gu(80)54 height: units.gu(80)
55 focus: true
56 Keys.forwardTo: [yearView,monthView,weekView,dayView,pageStack.currentPage,tabPage]
5557
56 headerColor: "#266249"58 headerColor: "#266249"
57 backgroundColor: "#478158"59 backgroundColor: "#478158"
@@ -184,9 +186,7 @@
184 // This is for wait that the app is load when newEvent is invoked by argument186 // This is for wait that the app is load when newEvent is invoked by argument
185 Timer {187 Timer {
186 id: timer188 id: timer
187 interval: 200;189 interval: 200; running: false; repeat: false
188 running: false;
189 repeat: false
190 onTriggered: {190 onTriggered: {
191 tabPage.newEvent();191 tabPage.newEvent();
192 }192 }
@@ -224,6 +224,28 @@
224 }224 }
225 }225 }
226226
227 Keys.onTabPressed: {
228 if( event.modifiers & Qt.ControlModifier) {
229 var currentTab = tabs.selectedTabIndex;
230 currentTab ++;
231 if( currentTab >= tabs.tabChildren.length){
232 currentTab = 0;
233 }
234 tabs.selectedTabIndex = currentTab;
235 }
236 }
237
238 Keys.onBacktabPressed: {
239 if( event.modifiers & Qt.ControlModifier) {
240 var currentTab = tabs.selectedTabIndex;
241 currentTab --;
242 if( currentTab < 0){
243 currentTab = tabs.tabChildren.length -1;
244 }
245 tabs.selectedTabIndex = currentTab;
246 }
247 }
248
227 Tabs{249 Tabs{
228 id: tabs250 id: tabs
229251
@@ -275,7 +297,6 @@
275 id: weekView297 id: weekView
276 anchors.fill: parent298 anchors.fill: parent
277 isCurrentPage: tabs.selectedTab == weekTab299 isCurrentPage: tabs.selectedTab == weekTab
278
279 onDayStartChanged: {300 onDayStartChanged: {
280 tabPage.currentDay = dayStart;301 tabPage.currentDay = dayStart;
281 }302 }

Subscribers

People subscribed via source and target branches

to status/vote changes: