Merge lp:~fboucault/task-app/use_adaptive_page_layout into lp:task-app

Proposed by Florian Boucault
Status: Needs review
Proposed branch: lp:~fboucault/task-app/use_adaptive_page_layout
Merge into: lp:task-app
Prerequisite: lp:~fboucault/task-app/migrate_toolkit_13
Diff against target: 161 lines (+20/-20)
6 files modified
app/components/DoneView.qml (+2/-2)
app/components/FilterView.qml (+2/-2)
app/components/PageWithBottomEdge.qml (+1/-1)
app/components/TaskView.qml (+3/-3)
app/components/TodoView.qml (+7/-7)
app/main.qml (+5/-5)
To merge this branch: bzr merge lp:~fboucault/task-app/use_adaptive_page_layout
Reviewer Review Type Date Requested Status
Victor Tuson Palau Pending
Review via email: mp+282907@code.launchpad.net

Commit message

Use AdaptivePageLayout to better support wider form factors (tablet, desktop)

To post a comment you must log in.
Revision history for this message
Florian Boucault (fboucault) wrote :

Unmerged revisions

46. By Florian Boucault

Use AdaptivePageLayout to better support wider form factors (tablet, desktop)

45. By Florian Boucault

Migrated to version 1.3 of the Ubuntu UI Toolkit

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/components/DoneView.qml'
2--- app/components/DoneView.qml 2016-01-18 09:41:52 +0000
3+++ app/components/DoneView.qml 2016-01-18 09:41:52 +0000
4@@ -40,7 +40,7 @@
5 todoView.push(todoDoneList.get(mItem))
6 }
7 }
8- pStack.pop()
9+ pageLayout.removePages(doneView)
10 doneView.refresh()
11 }
12
13@@ -49,7 +49,7 @@
14 doneView.taskManager.deleteTask(todoDoneList.get(mItem))
15 }
16 doneView.refresh()
17- pStack.pop()
18+ pageLayout.removePages(doneView)
19 }
20
21 Component {
22
23=== modified file 'app/components/FilterView.qml'
24--- app/components/FilterView.qml 2016-01-18 09:41:52 +0000
25+++ app/components/FilterView.qml 2016-01-18 09:41:52 +0000
26@@ -8,7 +8,7 @@
27 //Translator: page header to select a tag filter/ task list
28 title:i18n.tr("Select a filter")
29 property var filters
30- property var pStack
31+ property var pageLayout
32 property var todoview
33 ListModel {id: filterModel}
34
35@@ -21,7 +21,7 @@
36 progression: true
37 onClicked: {
38 todoview.refresh(filter)
39- filterView.pStack.pop()
40+ filterView.pageLayout.removePages(filterView)
41 filterView.destroy()
42 }
43 }
44
45=== modified file 'app/components/PageWithBottomEdge.qml'
46--- app/components/PageWithBottomEdge.qml 2016-01-18 09:41:52 +0000
47+++ app/components/PageWithBottomEdge.qml 2016-01-18 09:41:52 +0000
48@@ -104,7 +104,7 @@
49 {
50 if (edgeLoader.status === Loader.Ready) {
51 edgeLoader.item.active = true
52- page.pageStack.push(edgeLoader.item)
53+ page.pageStack.addPageToCurrentColumn(page.pageStack.primaryPage, edgeLoader.item)
54 if (edgeLoader.item.flickable) {
55 edgeLoader.item.flickable.contentY = -page.header.height
56 edgeLoader.item.flickable.returnToBounds()
57
58=== modified file 'app/components/TaskView.qml'
59--- app/components/TaskView.qml 2016-01-18 09:41:52 +0000
60+++ app/components/TaskView.qml 2016-01-18 09:41:52 +0000
61@@ -10,7 +10,7 @@
62 Page {
63 property var tasktoEdit
64 property var taskManager
65- property var pStack
66+ property var pageLayout
67 property var todoView
68 property int index: -1
69 signal applyChanges
70@@ -43,7 +43,7 @@
71 refresh()
72 }
73
74- onCancelChanges: pStack.pop()
75+ onCancelChanges: pageLayout.removePages(taskView)
76 onApplyChanges: {
77 //make sure the that task title in not empty
78 Qt.inputMethod.commit();
79@@ -70,7 +70,7 @@
80 if (index >-1)
81 todoView.pop(index)
82 todoView.push(tasktoEdit)
83- pStack.pop()
84+ pageLayout.removePages(taskView)
85 }
86 head.backAction: Action {
87 id: cancelAction
88
89=== modified file 'app/components/TodoView.qml'
90--- app/components/TodoView.qml 2016-01-18 09:41:52 +0000
91+++ app/components/TodoView.qml 2016-01-18 09:41:52 +0000
92@@ -86,17 +86,17 @@
93 var filters = taskManager.alltags()
94 filters.unshift(alltasktext, dueTodayText)
95 filters[filters.length] = noneText
96- var mFilterView = Filters.addFilterView(pStack,filters)
97- mFilterView.pStack=pStack
98+ var mFilterView = Filters.addFilterView(pageLayout,filters)
99+ mFilterView.pageLayout=pageLayout
100 mFilterView.todoview=todoView
101- pStack.push(mFilterView)
102+ pageLayout.addPageToNextColumn(pageLayout.primaryPage, mFilterView)
103 }
104 iconName: "hud"
105 },
106 Action {
107 //Translator:menu option to show all done/completed tasks
108 text: i18n.tr("Done Tasks")
109- onTriggered: { doneView.refresh();pStack.push(doneView)}
110+ onTriggered: { doneView.refresh();pageLayout.addPageToNextColumn(pageLayout.primaryPage, doneView)}
111 iconName: "select"
112 }
113 ]
114@@ -250,7 +250,7 @@
115 editView.taskManager = todoView.taskManager
116 editView.index = index
117 editView.refresh()
118- pStack.push(editView)
119+ pageLayout.addPageToNextColumn(pageLayout.primaryPage, editView)
120 }
121 }
122
123@@ -343,7 +343,7 @@
124 //create a task manager
125 todoView.taskManager = new Tasks.TaskManager()
126 editView.taskManager =todoView.taskManager
127- editView.pStack=pStack
128+ editView.pageLayout=pageLayout
129 editView.todoView =todoView
130 todoView.setBottomEdgePage("./TaskView.qml", {
131 //Translator: page title to create a new task
132@@ -351,7 +351,7 @@
133 "visible":true,
134 "taskManager": editView.taskManager,
135 "todoView": todoView,
136- "pStack":pStack
137+ "pageLayout":pageLayout
138 })
139
140 //load all saved tasks
141
142=== modified file 'app/main.qml'
143--- app/main.qml 2016-01-18 09:41:52 +0000
144+++ app/main.qml 2016-01-18 09:41:52 +0000
145@@ -23,11 +23,11 @@
146
147 width: units.gu(100)
148 height: units.gu(75)
149- PageStack {
150- id: pStack
151-
152- Component.onCompleted: push(todoView)
153-
154+ AdaptivePageLayout {
155+ id: pageLayout
156+ anchors.fill: parent
157+
158+ primaryPage: todoView
159 TodoView {
160 id:todoView
161 }

Subscribers

People subscribed via source and target branches