Merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk13 into lp:ubuntu-docviewer-app

Proposed by Stefano Verzegnassi on 2015-10-23
Status: Merged
Approved by: Roman Shchekin on 2015-11-27
Approved revision: 220
Merged at revision: 210
Proposed branch: lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk13
Merge into: lp:ubuntu-docviewer-app
Diff against target: 2460 lines (+798/-709)
47 files modified
debian/control (+1/-1)
po/com.ubuntu.docviewer.pot (+33/-76)
src/app/qml/common/CommandLineProxy.qml (+2/-2)
src/app/qml/common/DetailsPage.qml (+1/-1)
src/app/qml/common/EmptyState.qml (+2/-2)
src/app/qml/common/ErrorDialog.qml (+2/-2)
src/app/qml/common/HorizontalDivider.qml (+28/-0)
src/app/qml/common/PageWithBottomEdge.qml (+33/-43)
src/app/qml/common/PickImportedDialog.qml (+2/-2)
src/app/qml/common/RejectedImportDialog.qml (+2/-2)
src/app/qml/common/ResizeableSidebar.qml (+98/-0)
src/app/qml/common/SubtitledListItem.qml (+2/-2)
src/app/qml/common/TextFieldButtonPopover.qml (+58/-0)
src/app/qml/common/TextFieldWithButton.qml (+84/-0)
src/app/qml/common/UnknownTypeDialog.qml (+2/-2)
src/app/qml/common/VerticalDivider.qml (+35/-0)
src/app/qml/documentPage/DeleteFileDialog.qml (+2/-2)
src/app/qml/documentPage/DocumentDelegateActions.qml (+2/-2)
src/app/qml/documentPage/DocumentEmptyState.qml (+1/-1)
src/app/qml/documentPage/DocumentListDelegate.qml (+3/-3)
src/app/qml/documentPage/DocumentListView.qml (+1/-3)
src/app/qml/documentPage/DocumentPage.qml (+2/-2)
src/app/qml/documentPage/DocumentPageDefaultHeader.qml (+2/-2)
src/app/qml/documentPage/DocumentPagePickModeHeader.qml (+1/-1)
src/app/qml/documentPage/DocumentPageSearchHeader.qml (+1/-1)
src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml (+2/-4)
src/app/qml/documentPage/SearchEmptyState.qml (+1/-1)
src/app/qml/documentPage/SectionHeader.qml (+2/-2)
src/app/qml/documentPage/SharePage.qml (+1/-1)
src/app/qml/documentPage/SortSettingsDialog.qml (+2/-2)
src/app/qml/loView/LOViewDefaultHeader.qml (+31/-30)
src/app/qml/loView/LOViewGotoDialog.qml (+2/-2)
src/app/qml/loView/LOViewPage.qml (+39/-95)
src/app/qml/loView/LOViewZoomHeader.qml (+0/-59)
src/app/qml/loView/PanelButton.qml (+1/-1)
src/app/qml/loView/PartsView.qml (+112/-58)
src/app/qml/loView/SlideControllerPanel.qml (+0/-87)
src/app/qml/loView/ZoomSelector.qml (+129/-114)
src/app/qml/pdfView/PdfContentsPage.qml (+3/-8)
src/app/qml/pdfView/PdfView.qml (+28/-19)
src/app/qml/pdfView/PdfViewDefaultHeader.qml (+5/-19)
src/app/qml/pdfView/PdfViewDelegate.qml (+1/-1)
src/app/qml/pdfView/PdfViewGotoDialog.qml (+2/-2)
src/app/qml/textView/TextView.qml (+3/-3)
src/app/qml/textView/TextViewDefaultHeader.qml (+5/-19)
src/app/qml/ubuntu-docviewer-app.qml (+14/-29)
src/plugin/libreofficetoolkit-qml-plugin/qml/Viewer.qml (+15/-1)
To merge this branch: bzr merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk13
Reviewer Review Type Date Requested Status
Roman Shchekin 2015-10-23 Approve on 2015-11-27
Jenkins Bot continuous-integration Approve on 2015-11-27
Review via email: mp+275531@code.launchpad.net

Commit message

* Switch to Ubuntu Toolkit 1.3
* UI updated
* Improved support for zoom on desktop
* Updated framework to 14.04.1
* Moved components in the 'upstreamComponents' folder into 'common'
* Use the new BottomEdgeHint component in order to provide mouse/keyb controls for the bottom edge.
* Changed Header behaviour to default in the PDF viewer
* Use an horizontal PartsView for switching slides in portrait, small-width mode, instead of using the SlideControllerPanel component + BottomEdge.
* Removed some obsolete code

Description of the change

This MP may become very huge since there are big changes with ListItem(s), because of the introduction of ListItemLayout.

For that reason I will ask multiple reviews in order to split the diff into small parts.

The version of the toolkit we target is 1.3.1676+15.04.20151008-0ubuntu1, included in OTA-7.
Link: http://bazaar.launchpad.net/~ubuntu-sdk-team/ubuntu-ui-toolkit/staging/files/1676

Changes:
* Updated all the 'Ubuntu.*' imports to verstion 1.3
* New ZoomSelector UI
* Usage of the new enum 'textSize' property instead of string 'fontSize' in Labels
* Better support for zoom on desktop
* Usage of 'theme' singleton instead of deprecated 'Theme'
* Updated framework to 14.04.1
* Moved components in the 'upstreamComponents' folder into 'common'
* Use BottomEdgeHint in order to provide mouse/keyb controls for the bottom edge.
* Changed Header behaviour to default in the PDF viewer (the way we did the 'tap to show/hide' is broken with the upcoming UITK release)
* Use an horizontal PartsView for switching slides in portrait, small-width mode, instead of using the SlideControllerPanel component + BottomEdge.

WILL COME WITH SEPARATE MPs:
* Move all async logic used in LoViewPage in another component
* Fix broken Autopilot tests: it will be done in a following MP

To post a comment you must log in.
review: Needs Fixing (continuous-integration)
review: Approve (continuous-integration)
217. By Stefano Verzegnassi on 2015-11-27

[pdfview] Removed last reference to 'toggleHeaderVisibility'

218. By Stefano Verzegnassi on 2015-11-27

[textview] Removed file description from title

review: Needs Fixing (continuous-integration)
219. By Stefano Verzegnassi on 2015-11-27

Merged 'reboot' branch

review: Approve (continuous-integration)
220. By Stefano Verzegnassi on 2015-11-27

[loview] removed double-click-to-(un)zoom. to be added later.

review: Approve (continuous-integration)
Roman Shchekin (mrqtros) wrote :

Pretty happy to approve it! ;)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2015-10-27 18:47:09 +0000
3+++ debian/control 2015-11-27 16:47:37 +0000
4@@ -31,7 +31,7 @@
5 qtdeclarative5-documentviewer-pdf (= ${source:Version}),
6 suru-icon-theme (>= 14.04+15.10.20150707-0ubuntu1),
7 qtdeclarative5-qtquick2-plugin,
8- qtdeclarative5-ubuntu-ui-toolkit-plugin,
9+ qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1676) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1676),
10 qtdeclarative5-ubuntu-content1,
11 qtdeclarative5-quicklayouts-plugin,
12 qtdeclarative5-window-plugin
13
14=== modified file 'po/com.ubuntu.docviewer.pot'
15--- po/com.ubuntu.docviewer.pot 2015-11-24 16:01:19 +0000
16+++ po/com.ubuntu.docviewer.pot 2015-11-27 16:47:37 +0000
17@@ -8,7 +8,7 @@
18 msgstr ""
19 "Project-Id-Version: \n"
20 "Report-Msgid-Bugs-To: \n"
21-"POT-Creation-Date: 2015-11-24 17:00+0100\n"
22+"POT-Creation-Date: 2015-11-27 17:38+0100\n"
23 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
24 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
25 "Language-Team: LANGUAGE <LL@li.org>\n"
26@@ -42,9 +42,9 @@
27 msgstr ""
28
29 #: ../src/app/qml/common/DetailsPage.qml:25
30-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:106
31-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:97
32-#: ../src/app/qml/textView/TextViewDefaultHeader.qml:83
33+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:107
34+#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:83
35+#: ../src/app/qml/textView/TextViewDefaultHeader.qml:69
36 msgid "Details"
37 msgstr ""
38
39@@ -75,11 +75,8 @@
40 #: ../src/app/qml/common/ErrorDialog.qml:26
41 #: ../src/app/qml/common/PickImportedDialog.qml:53
42 #: ../src/app/qml/common/RejectedImportDialog.qml:38
43-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:33
44+#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:31
45 #: ../src/app/qml/documentPage/SortSettingsDialog.qml:53
46-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:70
47-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:61
48-#: ../src/app/qml/textView/TextViewDefaultHeader.qml:61
49 msgid "Close"
50 msgstr ""
51
52@@ -170,7 +167,7 @@
53
54 #: ../src/app/qml/documentPage/DeleteFileDialog.qml:61
55 #: ../src/app/qml/documentPage/DocumentDelegateActions.qml:27
56-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:55
57+#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:53
58 msgid "Delete"
59 msgstr ""
60
61@@ -240,10 +237,6 @@
62 msgstr ""
63
64 #: ../src/app/qml/documentPage/DocumentPageSearchHeader.qml:27
65-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:70
66-#: ../src/app/qml/loView/LOViewPage.qml:233
67-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:61
68-#: ../src/app/qml/textView/TextViewDefaultHeader.qml:61
69 msgid "Back"
70 msgstr ""
71
72@@ -251,11 +244,11 @@
73 msgid "search in documents..."
74 msgstr ""
75
76-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:42
77+#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:40
78 msgid "Select None"
79 msgstr ""
80
81-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:42
82+#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:40
83 msgid "Select All"
84 msgstr ""
85
86@@ -312,52 +305,48 @@
87 msgid "Reverse order"
88 msgstr ""
89
90-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:47
91+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:51
92 #: ../src/app/qml/textView/TextView.qml:42
93 msgid "Loading..."
94 msgstr ""
95
96-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:51
97+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:55
98 msgid "LibreOffice text document"
99 msgstr ""
100
101-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:53
102+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:57
103 msgid "LibreOffice spread sheet"
104 msgstr ""
105
106-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:55
107+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:59
108 msgid "LibreOffice presentation"
109 msgstr ""
110
111-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:57
112+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:61
113 msgid "LibreOffice Draw document"
114 msgstr ""
115
116-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:59
117+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:63
118 msgid "Unknown LibreOffice document"
119 msgstr ""
120
121-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:61
122+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:65
123 msgid "Unknown type document"
124 msgstr ""
125
126-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:86
127-msgid "Show zoom controls"
128-msgstr ""
129-
130-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:93
131+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:94
132 msgid "Go to position..."
133 msgstr ""
134
135-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
136-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:91
137-#: ../src/app/qml/textView/TextViewDefaultHeader.qml:77
138+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:101
139+#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
140+#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
141 msgid "Disable night mode"
142 msgstr ""
143
144-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
145-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:91
146-#: ../src/app/qml/textView/TextViewDefaultHeader.qml:77
147+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:101
148+#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
149+#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
150 msgid "Enable night mode"
151 msgstr ""
152
153@@ -374,63 +363,31 @@
154 msgid "GO!"
155 msgstr ""
156
157-#: ../src/app/qml/loView/LOViewPage.qml:35
158-#: ../src/app/qml/loView/LOViewPage.qml:231
159-msgid "Slides"
160-msgstr ""
161-
162-#: ../src/app/qml/loView/LOViewPage.qml:188
163+#: ../src/app/qml/loView/LOViewPage.qml:175
164 msgid "LibreOffice binaries not found."
165 msgstr ""
166
167-#: ../src/app/qml/loView/LOViewPage.qml:191
168+#: ../src/app/qml/loView/LOViewPage.qml:178
169 msgid "Error while loading LibreOffice."
170 msgstr ""
171
172-#: ../src/app/qml/loView/LOViewPage.qml:194
173+#: ../src/app/qml/loView/LOViewPage.qml:181
174 msgid ""
175 "Document not loaded.\n"
176 "The requested document may be corrupt."
177 msgstr ""
178
179-#: ../src/app/qml/loView/LOViewZoomHeader.qml:42
180-msgid "Hide zoom controls"
181-msgstr ""
182-
183-#: ../src/app/qml/loView/LOViewZoomHeader.qml:49
184-msgid "Zoom in"
185-msgstr ""
186-
187-#: ../src/app/qml/loView/LOViewZoomHeader.qml:55
188-msgid "Zoom out"
189-msgstr ""
190-
191-#: ../src/app/qml/loView/SlideControllerPanel.qml:62
192-#, qt-format
193-msgid "Slide %1 of %2"
194-msgstr ""
195-
196-#: ../src/app/qml/loView/ZoomSelector.qml:29
197-msgid "Automatic (Fit width)"
198-msgstr ""
199-
200-#: ../src/app/qml/loView/ZoomSelector.qml:94
201-#, qt-format
202-msgid "Automatic (%1%)"
203-msgstr ""
204-
205-#: ../src/app/qml/loView/ZoomSelector.qml:95
206-#, qt-format
207-msgid "Zoom: %1%"
208+#: ../src/app/qml/loView/ZoomSelector.qml:116
209+msgid "Fit width"
210 msgstr ""
211
212 #. TRANSLATORS: "Contents" refers to the "Table of Contents" of a PDF document.
213-#: ../src/app/qml/pdfView/PdfContentsPage.qml:32
214+#: ../src/app/qml/pdfView/PdfContentsPage.qml:30
215 #: ../src/app/qml/pdfView/PdfView.qml:37
216 msgid "Contents"
217 msgstr ""
218
219-#: ../src/app/qml/pdfView/PdfContentsPage.qml:38
220+#: ../src/app/qml/pdfView/PdfContentsPage.qml:36
221 msgid "Hide table of contents"
222 msgstr ""
223
224@@ -441,7 +398,7 @@
225 msgid "Page %1 of %2"
226 msgstr ""
227
228-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:85
229+#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:71
230 msgid "Go to page..."
231 msgstr ""
232
233@@ -454,7 +411,7 @@
234 msgid "Choose a page between 1 and %1"
235 msgstr ""
236
237-#: ../src/app/qml/ubuntu-docviewer-app.qml:130
238+#: ../src/app/qml/ubuntu-docviewer-app.qml:115
239 msgid "File does not exist."
240 msgstr ""
241
242@@ -472,10 +429,10 @@
243 msgid "copy %1"
244 msgstr ""
245
246-#: /tmp/build-reboot-cmake-refactor-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:1
247+#: /tmp/build-reboot-uitk13-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:1
248 msgid "Document Viewer"
249 msgstr ""
250
251-#: /tmp/build-reboot-cmake-refactor-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:2
252+#: /tmp/build-reboot-uitk13-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:2
253 msgid "documents;viewer;pdf;reader;"
254 msgstr ""
255
256=== modified file 'src/app/qml/common/CommandLineProxy.qml'
257--- src/app/qml/common/CommandLineProxy.qml 2015-10-17 00:45:46 +0000
258+++ src/app/qml/common/CommandLineProxy.qml 2015-11-27 16:47:37 +0000
259@@ -14,8 +14,8 @@
260 * along with this program. If not, see <http://www.gnu.org/licenses/>.
261 */
262
263-import QtQuick 2.3
264-import Ubuntu.Components 1.1
265+import QtQuick 2.4
266+import Ubuntu.Components 1.3
267
268 Item {
269 id: rootItem
270
271=== modified file 'src/app/qml/common/DetailsPage.qml'
272--- src/app/qml/common/DetailsPage.qml 2015-10-19 23:07:50 +0000
273+++ src/app/qml/common/DetailsPage.qml 2015-11-27 16:47:37 +0000
274@@ -15,7 +15,7 @@
275 */
276
277 import QtQuick 2.4
278-import Ubuntu.Components 1.2
279+import Ubuntu.Components 1.3
280
281 import "utils.js" as Utils
282
283
284=== renamed file 'src/app/qml/upstreamComponents/EmptyState.qml' => 'src/app/qml/common/EmptyState.qml'
285--- src/app/qml/upstreamComponents/EmptyState.qml 2015-10-10 12:03:30 +0000
286+++ src/app/qml/common/EmptyState.qml 2015-11-27 16:47:37 +0000
287@@ -17,7 +17,7 @@
288 */
289
290 import QtQuick 2.4
291-import Ubuntu.Components 1.2
292+import Ubuntu.Components 1.3
293
294 /*
295 Component which displays an empty state (approved by design). It offers an
296@@ -47,7 +47,7 @@
297 anchors.top: emptyIcon.bottom
298 anchors.topMargin: units.gu(5)
299 anchors.horizontalCenter: parent.horizontalCenter
300- fontSize: "large"
301+ textSize: Label.Large
302 font.bold: true
303 }
304
305
306=== modified file 'src/app/qml/common/ErrorDialog.qml'
307--- src/app/qml/common/ErrorDialog.qml 2015-11-11 19:59:15 +0000
308+++ src/app/qml/common/ErrorDialog.qml 2015-11-27 16:47:37 +0000
309@@ -15,8 +15,8 @@
310 */
311
312 import QtQuick 2.4
313-import Ubuntu.Components 1.2
314-import Ubuntu.Components.Popups 1.0
315+import Ubuntu.Components 1.3
316+import Ubuntu.Components.Popups 1.3
317
318 Dialog {
319 id: errorDialog
320
321=== added file 'src/app/qml/common/HorizontalDivider.qml'
322--- src/app/qml/common/HorizontalDivider.qml 1970-01-01 00:00:00 +0000
323+++ src/app/qml/common/HorizontalDivider.qml 2015-11-27 16:47:37 +0000
324@@ -0,0 +1,28 @@
325+/*
326+ * Copyright (C) 2015 Canonical, Ltd.
327+ *
328+ * This program is free software; you can redistribute it and/or modify
329+ * it under the terms of the GNU General Public License as published by
330+ * the Free Software Foundation; version 3.
331+ *
332+ * This program is distributed in the hope that it will be useful,
333+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
334+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
335+ * GNU General Public License for more details.
336+ *
337+ * You should have received a copy of the GNU General Public License
338+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
339+ */
340+
341+import QtQuick 2.4
342+import Ubuntu.Components 1.3
343+
344+Rectangle {
345+ height: units.dp(2)
346+ gradient: Gradient {
347+ GradientStop { position: 0.0; color: Qt.rgba(0, 0, 0, 0.1) }
348+ GradientStop { position: 0.49; color: Qt.rgba(0, 0, 0, 0.1) }
349+ GradientStop { position: 0.5; color: Qt.rgba(1, 1, 1, 0.4) }
350+ GradientStop { position: 1.0; color: Qt.rgba(1, 1, 1, 0.4) }
351+ }
352+}
353
354=== renamed file 'src/app/qml/upstreamComponents/PageWithBottomEdge.qml' => 'src/app/qml/common/PageWithBottomEdge.qml'
355--- src/app/qml/upstreamComponents/PageWithBottomEdge.qml 2015-10-10 12:03:30 +0000
356+++ src/app/qml/common/PageWithBottomEdge.qml 2015-11-27 16:47:37 +0000
357@@ -1,5 +1,5 @@
358 /*
359- * Copyright (C) 2014 Canonical, Ltd.
360+ * Copyright (C) 2014, 2015 Canonical, Ltd.
361 *
362 * This program is free software; you can redistribute it and/or modify
363 * it under the terms of the GNU General Public License as published by
364@@ -63,14 +63,14 @@
365 */
366
367 import QtQuick 2.4
368-import Ubuntu.Components 1.2
369+import Ubuntu.Components 1.3
370
371 Page {
372 id: page
373
374 property alias bottomEdgePageComponent: edgeLoader.sourceComponent
375 property alias bottomEdgePageSource: edgeLoader.source
376- property alias bottomEdgeTitle: tipLabel.text
377+ property alias bottomEdgeTitle: tip.text
378 property bool bottomEdgeEnabled: true
379 property int bottomEdgeExpandThreshold: page.height * 0.2
380 property int bottomEdgeExposedArea: bottomEdge.state !== "expanded" ? (page.height - bottomEdge.y - bottomEdge.tipHeight) : _areaWhenExpanded
381@@ -142,50 +142,36 @@
382 z: 1
383 }
384
385- UbuntuShape {
386+ BottomEdgeHint {
387 id: tip
388 objectName: "bottomEdgeTip"
389
390- property bool hidden: (activeFocus === false) || ((bottomEdge.y - units.gu(1)) < tip.y)
391-
392 enabled: mouseArea.enabled
393 visible: page.bottomEdgeEnabled
394- anchors {
395- bottom: parent.bottom
396- horizontalCenter: bottomEdge.horizontalCenter
397- bottomMargin: hidden ? - height + units.gu(1) : -units.gu(1)
398- Behavior on bottomMargin {
399- SequentialAnimation {
400- // wait some msecs in case of the focus change again, to avoid flickering
401- PauseAnimation {
402- duration: 300
403- }
404- UbuntuNumberAnimation {
405- duration: UbuntuAnimation.SnapDuration
406- }
407- }
408- }
409- }
410-
411 z: 1
412- width: tipLabel.paintedWidth + units.gu(6)
413- height: bottomEdge.tipHeight + units.gu(1)
414- color: Theme.palette.normal.overlay
415- Label {
416- id: tipLabel
417-
418- anchors {
419- top: parent.top
420- left: parent.left
421- right: parent.right
422+
423+ onClicked: bottomEdge.state = "expanded"
424+
425+ Connections {
426+ target: mouseArea
427+ onClosedChanged: {
428+ if (!mouseArea.closed) {
429+ tip.state = "Visible";
430+ }
431 }
432- height: bottomEdge.tipHeight
433- verticalAlignment: Text.AlignVCenter
434- horizontalAlignment: Text.AlignHCenter
435- opacity: tip.hidden ? 0.0 : 1.0
436- Behavior on opacity {
437- UbuntuNumberAnimation {
438- duration: UbuntuAnimation.SnapDuration
439+ }
440+
441+ Connections {
442+ target: page.flickable
443+ onVerticalVelocityChanged: {
444+ if (!mouseArea.closed) {
445+ return;
446+ }
447+
448+ if (page.flickable.verticalVelocity > 0) {
449+ tip.state = "Hidden";
450+ } else if (page.flickable.verticalVelocity < 0) {
451+ tip.state = "Visible";
452 }
453 }
454 }
455@@ -213,6 +199,7 @@
456
457 property real previousY: -1
458 property string dragDirection: "None"
459+ property bool closed: drag.target.y == drag.maximumY && !mouseArea.pressed
460
461 preventStealing: true
462 drag {
463@@ -231,7 +218,7 @@
464
465 }
466 height: bottomEdge.tipHeight
467- z: 1
468+ z: 10
469
470 onReleased: {
471 page.bottomEdgeReleased()
472@@ -250,6 +237,9 @@
473 tip.forceActiveFocus()
474 }
475
476+ // Propagate click event to the BottomEdgeHint
477+ onClicked: tip.clicked()
478+
479 onMouseYChanged: {
480 var yOffset = previousY - mouseY
481 // skip if was a small move
482@@ -268,8 +258,8 @@
483 readonly property int tipHeight: units.gu(3)
484 readonly property int pageStartY: 0
485
486- z: 1
487- color: Theme.palette.normal.background
488+ z: Number.MAX_VALUE
489+ color: theme.palette.normal.background
490 clip: true
491 anchors {
492 left: parent.left
493
494=== modified file 'src/app/qml/common/PickImportedDialog.qml'
495--- src/app/qml/common/PickImportedDialog.qml 2015-10-10 12:03:30 +0000
496+++ src/app/qml/common/PickImportedDialog.qml 2015-11-27 16:47:37 +0000
497@@ -15,8 +15,8 @@
498 */
499
500 import QtQuick 2.4
501-import Ubuntu.Components 1.2
502-import Ubuntu.Components.Popups 1.0
503+import Ubuntu.Components 1.3
504+import Ubuntu.Components.Popups 1.3
505
506 import "utils.js" as Utils
507
508
509=== modified file 'src/app/qml/common/RejectedImportDialog.qml'
510--- src/app/qml/common/RejectedImportDialog.qml 2015-10-10 12:03:30 +0000
511+++ src/app/qml/common/RejectedImportDialog.qml 2015-11-27 16:47:37 +0000
512@@ -15,8 +15,8 @@
513 */
514
515 import QtQuick 2.4
516-import Ubuntu.Components 1.2
517-import Ubuntu.Components.Popups 1.0
518+import Ubuntu.Components 1.3
519+import Ubuntu.Components.Popups 1.3
520
521 Dialog {
522 id: rejectedDialog
523
524=== added file 'src/app/qml/common/ResizeableSidebar.qml'
525--- src/app/qml/common/ResizeableSidebar.qml 1970-01-01 00:00:00 +0000
526+++ src/app/qml/common/ResizeableSidebar.qml 2015-11-27 16:47:37 +0000
527@@ -0,0 +1,98 @@
528+/*
529+ * Copyright (C) 2015 Canonical, Ltd.
530+ *
531+ * This program is free software; you can redistribute it and/or modify
532+ * it under the terms of the GNU General Public License as published by
533+ * the Free Software Foundation; version 3.
534+ *
535+ * This program is distributed in the hope that it will be useful,
536+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
537+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
538+ * GNU General Public License for more details.
539+ *
540+ * You should have received a copy of the GNU General Public License
541+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
542+ */
543+
544+import QtQuick 2.4
545+import Ubuntu.Components 1.3
546+
547+Item {
548+ id: resizeableSidebar
549+
550+ /* Please remember to set left or right anchor */
551+ anchors { top: parent.top; bottom: parent.bottom }
552+
553+ property int minimumWidth: units.gu(20)
554+ property int maximumWidth: units.gu(40)
555+
556+ width: visible ? units.gu(40) : 0
557+
558+ Rectangle {
559+ id: verticalDivider
560+ anchors {
561+ top: parent.top
562+ bottom: parent.bottom
563+ right: resizeableSidebar.anchors.left ? parent.right : undefined
564+ left: resizeableSidebar.anchors.left ? undefined : parent.left
565+ leftMargin: units.dp(2)
566+ rightMargin: units.dp(2)
567+ }
568+ width: units.dp(2)
569+ color: Theme.palette.selected.background
570+
571+ // Stay above the sidebar content
572+ z: 10
573+
574+ MouseArea {
575+ id: resizerSensing
576+ objectName: "Divider"
577+ enabled: verticalDivider.width > 0
578+ anchors {
579+ fill: parent
580+ leftMargin: enabled ? -units.gu(1) : 0
581+ rightMargin: enabled ? -units.gu(1) : 0
582+ }
583+ cursorShape: Qt.SizeHorCursor
584+ drag {
585+ axis: Drag.XAxis
586+ target: resizer
587+ smoothed: false
588+ minimumX: resizeableSidebar.minimumWidth
589+ maximumX: resizeableSidebar.maximumWidth
590+ }
591+ onPressed: resizer.x = resizeableSidebar.width
592+ }
593+ states: State {
594+ name: "active"
595+ when: resizerSensing.pressed || resizerSensing.containsMouse
596+ PropertyChanges {
597+ target: verticalDivider
598+ color: Qt.darker(Theme.palette.normal.background, 1.5)
599+ }
600+ }
601+ transitions: Transition {
602+ from: ""
603+ to: "*"
604+ reversible: true
605+ ColorAnimation {
606+ target: verticalDivider
607+ property: "color"
608+ duration: UbuntuAnimation.SlowDuration
609+ }
610+ }
611+ }
612+ Item {
613+ id: resizer
614+ height: parent.height
615+ onXChanged: resizeableSidebar.width = x
616+ }
617+
618+ VerticalDivider {
619+ anchors {
620+ top: parent.top
621+ bottom: parent.bottom
622+ right: parent.right
623+ }
624+ }
625+}
626
627=== modified file 'src/app/qml/common/SubtitledListItem.qml'
628--- src/app/qml/common/SubtitledListItem.qml 2015-10-19 23:07:50 +0000
629+++ src/app/qml/common/SubtitledListItem.qml 2015-11-27 16:47:37 +0000
630@@ -15,7 +15,7 @@
631 */
632
633 import QtQuick 2.4
634-import Ubuntu.Components 1.2
635+import Ubuntu.Components 1.3
636
637 ListItem {
638 id: listItemSubtitled
639@@ -35,7 +35,7 @@
640 }
641 Label {
642 id: subLabel
643- fontSize: "small"
644+ textSize: Label.Small
645 }
646 }
647 }
648
649=== added file 'src/app/qml/common/TextFieldButtonPopover.qml'
650--- src/app/qml/common/TextFieldButtonPopover.qml 1970-01-01 00:00:00 +0000
651+++ src/app/qml/common/TextFieldButtonPopover.qml 2015-11-27 16:47:37 +0000
652@@ -0,0 +1,58 @@
653+/*
654+ * Copyright (C) 2015 Stefano Verzegnassi
655+ *
656+ * This program is free software; you can redistribute it and/or modify
657+ * it under the terms of the GNU General Public License as published by
658+ * the Free Software Foundation; version 3.
659+ *
660+ * This program is distributed in the hope that it will be useful,
661+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
662+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
663+ * GNU General Public License for more details.
664+ *
665+ * You should have received a copy of the GNU General Public License
666+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
667+ */
668+
669+import QtQuick 2.4
670+import Ubuntu.Components 1.3
671+import Ubuntu.Components.Popups 1.3
672+
673+Popover {
674+ id: textFieldButtonPopover
675+
676+ default property alias popoverData: layout.data
677+
678+ signal close()
679+
680+ autoClose: false
681+ contentHeight: layout.height + units.gu(4)
682+ contentWidth: units.gu(24)
683+
684+ onClose: PopupUtils.close(textFieldButtonPopover)
685+
686+ // We don't use 'autoClose' property, since we want to propagate
687+ // mouse/touch events to other items (e.g. when zoomSelectorDialogue
688+ // is visible, and user taps the zoom+ button on its right, we want
689+ // the zoom button to receive the event).
690+ InverseMouseArea {
691+ anchors.fill: parent
692+ propagateComposedEvents: true
693+
694+ onPressed: {
695+ mouse.accepted = false
696+ PopupUtils.close(textFieldButtonPopover)
697+ }
698+ }
699+
700+ Column {
701+ id: layout
702+ spacing: units.gu(0.5)
703+ anchors {
704+ top: parent.top
705+ left: parent.left
706+ right: parent.right
707+ margins: units.gu(2)
708+ }
709+ }
710+}
711
712=== added file 'src/app/qml/common/TextFieldWithButton.qml'
713--- src/app/qml/common/TextFieldWithButton.qml 1970-01-01 00:00:00 +0000
714+++ src/app/qml/common/TextFieldWithButton.qml 2015-11-27 16:47:37 +0000
715@@ -0,0 +1,84 @@
716+/*
717+ * Copyright (C) 2015 Stefano Verzegnassi
718+ *
719+ * This program is free software; you can redistribute it and/or modify
720+ * it under the terms of the GNU General Public License as published by
721+ * the Free Software Foundation; version 3.
722+ *
723+ * This program is distributed in the hope that it will be useful,
724+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
725+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
726+ * GNU General Public License for more details.
727+ *
728+ * You should have received a copy of the GNU General Public License
729+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
730+ */
731+
732+import QtQuick 2.4
733+import Ubuntu.Components 1.3
734+import Ubuntu.Components.Popups 1.3
735+import Ubuntu.Components.Themes.Ambiance 1.3 as Theme
736+
737+TextField {
738+ id: textField
739+
740+ // FIXME: This property is meant to be read-only, but we need to set its value herein.
741+ property bool expanded: false
742+
743+ property Component popover
744+
745+ secondaryItem: AbstractButton {
746+ id: popoverButton
747+
748+ height: parent.height
749+ visible: !textField.highlighted
750+ width: visible ? height : 0
751+
752+ onClicked: {
753+ textField.expanded = !textField.expanded
754+
755+ if (textField.expanded) {
756+ var dialog = PopupUtils.open(textField.popover, popoverButton)
757+
758+ dialog.Component.onDestruction.connect(function() {
759+ textField.expanded = false
760+ })
761+ }
762+ }
763+
764+ VerticalDivider { anchors { top: parent.top; bottom: parent.bottom; left: parent.left } }
765+
766+ Rectangle {
767+ anchors.fill: parent
768+ color: theme.palette.selected.background
769+ visible: textField.expanded
770+ }
771+
772+ Icon {
773+ width: units.gu(2); height: width
774+ anchors.centerIn: parent
775+
776+ name: "go-down"
777+ color: "Grey"
778+ rotation: textField.expanded ? 180 : 0
779+ Behavior on rotation { UbuntuNumberAnimation { } }
780+ }
781+ }
782+
783+ default property alias textFieldData: textFieldContent.data
784+ Item {
785+ id: textFieldContent
786+ anchors {
787+ fill: parent
788+ rightMargin: popoverButton.width
789+ }
790+ }
791+
792+ /* style */
793+ style: Theme.TextFieldStyle {
794+ background: UbuntuShape {
795+ anchors.fill: parent
796+ aspect: UbuntuShape.DropShadow
797+ }
798+ }
799+}
800
801=== modified file 'src/app/qml/common/UnknownTypeDialog.qml'
802--- src/app/qml/common/UnknownTypeDialog.qml 2015-10-10 12:03:30 +0000
803+++ src/app/qml/common/UnknownTypeDialog.qml 2015-11-27 16:47:37 +0000
804@@ -15,8 +15,8 @@
805 */
806
807 import QtQuick 2.4
808-import Ubuntu.Components 1.2
809-import Ubuntu.Components.Popups 1.0
810+import Ubuntu.Components 1.3
811+import Ubuntu.Components.Popups 1.3
812 import QtQuick.Layouts 1.1
813
814 import "loadComponent.js" as LoadComponent
815
816=== added file 'src/app/qml/common/VerticalDivider.qml'
817--- src/app/qml/common/VerticalDivider.qml 1970-01-01 00:00:00 +0000
818+++ src/app/qml/common/VerticalDivider.qml 2015-11-27 16:47:37 +0000
819@@ -0,0 +1,35 @@
820+/*
821+ * Copyright (C) 2015 Canonical, Ltd.
822+ *
823+ * This program is free software; you can redistribute it and/or modify
824+ * it under the terms of the GNU General Public License as published by
825+ * the Free Software Foundation; version 3.
826+ *
827+ * This program is distributed in the hope that it will be useful,
828+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
829+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
830+ * GNU General Public License for more details.
831+ *
832+ * You should have received a copy of the GNU General Public License
833+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
834+ */
835+
836+import QtQuick 2.4
837+import Ubuntu.Components 1.3
838+
839+Item {
840+ width: units.dp(2)
841+
842+ Rectangle {
843+ height: parent.width
844+ width: parent.height
845+ rotation: 90; anchors.centerIn: parent
846+
847+ gradient: Gradient {
848+ GradientStop { position: 0.0; color: Qt.rgba(0, 0, 0, 0.1) }
849+ GradientStop { position: 0.49; color: Qt.rgba(0, 0, 0, 0.1) }
850+ GradientStop { position: 0.5; color: Qt.rgba(1, 1, 1, 0.4) }
851+ GradientStop { position: 1.0; color: Qt.rgba(1, 1, 1, 0.4) }
852+ }
853+ }
854+}
855
856=== modified file 'src/app/qml/documentPage/DeleteFileDialog.qml'
857--- src/app/qml/documentPage/DeleteFileDialog.qml 2015-10-14 22:54:00 +0000
858+++ src/app/qml/documentPage/DeleteFileDialog.qml 2015-11-27 16:47:37 +0000
859@@ -16,8 +16,8 @@
860 */
861
862 import QtQuick 2.4
863-import Ubuntu.Components 1.2
864-import Ubuntu.Components.Popups 1.0
865+import Ubuntu.Components 1.3
866+import Ubuntu.Components.Popups 1.3
867 import QtQuick.Layouts 1.1
868
869 Dialog {
870
871=== modified file 'src/app/qml/documentPage/DocumentDelegateActions.qml'
872--- src/app/qml/documentPage/DocumentDelegateActions.qml 2015-10-14 22:54:00 +0000
873+++ src/app/qml/documentPage/DocumentDelegateActions.qml 2015-11-27 16:47:37 +0000
874@@ -15,8 +15,8 @@
875 */
876
877 import QtQuick 2.4
878-import Ubuntu.Components 1.2
879-import Ubuntu.Components.Popups 1.0
880+import Ubuntu.Components 1.3
881+import Ubuntu.Components.Popups 1.3
882
883 // TODO: Probably requires some change in order to work with latest ListItem 1.2
884
885
886=== modified file 'src/app/qml/documentPage/DocumentEmptyState.qml'
887--- src/app/qml/documentPage/DocumentEmptyState.qml 2015-10-10 12:03:30 +0000
888+++ src/app/qml/documentPage/DocumentEmptyState.qml 2015-11-27 16:47:37 +0000
889@@ -15,7 +15,7 @@
890 */
891
892 import QtQuick 2.4
893-import "../upstreamComponents"
894+import "../common"
895
896 Item {
897 anchors.fill: parent
898
899=== modified file 'src/app/qml/documentPage/DocumentListDelegate.qml'
900--- src/app/qml/documentPage/DocumentListDelegate.qml 2015-10-10 12:03:30 +0000
901+++ src/app/qml/documentPage/DocumentListDelegate.qml 2015-11-27 16:47:37 +0000
902@@ -15,7 +15,7 @@
903 */
904
905 import QtQuick 2.4
906-import Ubuntu.Components 1.2
907+import Ubuntu.Components 1.3
908 import QtQuick.Layouts 1.1
909 import DocumentViewer 1.0
910
911@@ -57,7 +57,7 @@
912 }
913 Label {
914 text: Utils.printSize(i18n, model.size)
915- fontSize: "small"
916+ textSize: Label.Small
917 }
918 }
919
920@@ -65,7 +65,7 @@
921 width: parent.width
922 Label {
923 text: internal.formattedDateTime()
924- fontSize: "small"
925+ textSize: Label.Small
926
927 Layout.fillWidth: true
928 }
929
930=== modified file 'src/app/qml/documentPage/DocumentListView.qml'
931--- src/app/qml/documentPage/DocumentListView.qml 2015-10-10 12:03:30 +0000
932+++ src/app/qml/documentPage/DocumentListView.qml 2015-11-27 16:47:37 +0000
933@@ -15,9 +15,7 @@
934 */
935
936 import QtQuick 2.4
937-import Ubuntu.Components 1.2
938-
939-import "../upstreamComponents"
940+import Ubuntu.Components 1.3
941
942 ListView {
943 id: documentListView
944
945=== modified file 'src/app/qml/documentPage/DocumentPage.qml'
946--- src/app/qml/documentPage/DocumentPage.qml 2015-10-10 12:03:30 +0000
947+++ src/app/qml/documentPage/DocumentPage.qml 2015-11-27 16:47:37 +0000
948@@ -15,7 +15,7 @@
949 */
950
951 import QtQuick 2.4
952-import Ubuntu.Components 1.2
953+import Ubuntu.Components 1.3
954 import Qt.labs.settings 1.0
955
956 Page {
957@@ -52,7 +52,7 @@
958 if (folderModel.count === 0) {
959 return documentPage.state == "search"
960 ? Qt.resolvedUrl("SearchEmptyState.qml")
961- : Qt.resolvedUrl("BrowserEmptyState.qml")
962+ : Qt.resolvedUrl("DocumentEmptyState.qml")
963 }
964
965 return Qt.resolvedUrl("DocumentListView.qml")
966
967=== modified file 'src/app/qml/documentPage/DocumentPageDefaultHeader.qml'
968--- src/app/qml/documentPage/DocumentPageDefaultHeader.qml 2015-10-10 12:03:30 +0000
969+++ src/app/qml/documentPage/DocumentPageDefaultHeader.qml 2015-11-27 16:47:37 +0000
970@@ -15,8 +15,8 @@
971 */
972
973 import QtQuick 2.4
974-import Ubuntu.Components 1.2
975-import Ubuntu.Components.Popups 1.0
976+import Ubuntu.Components 1.3
977+import Ubuntu.Components.Popups 1.3
978
979 PageHeadState {
980 id: rootItem
981
982=== modified file 'src/app/qml/documentPage/DocumentPagePickModeHeader.qml'
983--- src/app/qml/documentPage/DocumentPagePickModeHeader.qml 2015-10-10 12:03:30 +0000
984+++ src/app/qml/documentPage/DocumentPagePickModeHeader.qml 2015-11-27 16:47:37 +0000
985@@ -15,7 +15,7 @@
986 */
987
988 import QtQuick 2.4
989-import Ubuntu.Components 1.2
990+import Ubuntu.Components 1.3
991 import Ubuntu.Content 1.1
992
993 PageHeadState {
994
995=== modified file 'src/app/qml/documentPage/DocumentPageSearchHeader.qml'
996--- src/app/qml/documentPage/DocumentPageSearchHeader.qml 2015-10-10 12:03:30 +0000
997+++ src/app/qml/documentPage/DocumentPageSearchHeader.qml 2015-11-27 16:47:37 +0000
998@@ -15,7 +15,7 @@
999 */
1000
1001 import QtQuick 2.4
1002-import Ubuntu.Components 1.2
1003+import Ubuntu.Components 1.3
1004
1005 PageHeadState {
1006 id: rootItem
1007
1008=== modified file 'src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml'
1009--- src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml 2015-10-10 12:03:30 +0000
1010+++ src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml 2015-11-27 16:47:37 +0000
1011@@ -15,10 +15,8 @@
1012 */
1013
1014 import QtQuick 2.4
1015-import Ubuntu.Components 1.2
1016-import Ubuntu.Components.Popups 1.0
1017-
1018-import "../upstreamComponents"
1019+import Ubuntu.Components 1.3
1020+import Ubuntu.Components.Popups 1.3
1021
1022 PageHeadState {
1023 id: rootItem
1024
1025=== modified file 'src/app/qml/documentPage/SearchEmptyState.qml'
1026--- src/app/qml/documentPage/SearchEmptyState.qml 2015-10-10 12:03:30 +0000
1027+++ src/app/qml/documentPage/SearchEmptyState.qml 2015-11-27 16:47:37 +0000
1028@@ -15,7 +15,7 @@
1029 */
1030
1031 import QtQuick 2.4
1032-import "../upstreamComponents"
1033+import "../common"
1034
1035 Item {
1036 anchors.fill: parent
1037
1038=== modified file 'src/app/qml/documentPage/SectionHeader.qml'
1039--- src/app/qml/documentPage/SectionHeader.qml 2015-10-10 12:03:30 +0000
1040+++ src/app/qml/documentPage/SectionHeader.qml 2015-11-27 16:47:37 +0000
1041@@ -1,6 +1,6 @@
1042 import QtQuick 2.4
1043-import Ubuntu.Components 1.2
1044-import Ubuntu.Components.ListItems 1.0 as ListItem
1045+import Ubuntu.Components 1.3
1046+import Ubuntu.Components.ListItems 1.3 as ListItem
1047 import DocumentViewer 1.0
1048
1049 ListItem.Header {
1050
1051=== modified file 'src/app/qml/documentPage/SharePage.qml'
1052--- src/app/qml/documentPage/SharePage.qml 2015-10-10 12:03:30 +0000
1053+++ src/app/qml/documentPage/SharePage.qml 2015-11-27 16:47:37 +0000
1054@@ -15,7 +15,7 @@
1055 */
1056
1057 import QtQuick 2.4
1058-import Ubuntu.Components 1.2
1059+import Ubuntu.Components 1.3
1060 import Ubuntu.Content 1.1
1061
1062 Page {
1063
1064=== modified file 'src/app/qml/documentPage/SortSettingsDialog.qml'
1065--- src/app/qml/documentPage/SortSettingsDialog.qml 2015-10-18 22:36:11 +0000
1066+++ src/app/qml/documentPage/SortSettingsDialog.qml 2015-11-27 16:47:37 +0000
1067@@ -16,8 +16,8 @@
1068 */
1069
1070 import QtQuick 2.4
1071-import Ubuntu.Components 1.2
1072-import Ubuntu.Components.Popups 1.0
1073+import Ubuntu.Components 1.3
1074+import Ubuntu.Components.Popups 1.3
1075 import QtQuick.Layouts 1.1
1076
1077 Dialog {
1078
1079=== modified file 'src/app/qml/loView/LOViewDefaultHeader.qml'
1080--- src/app/qml/loView/LOViewDefaultHeader.qml 2015-10-19 11:30:01 +0000
1081+++ src/app/qml/loView/LOViewDefaultHeader.qml 2015-11-27 16:47:37 +0000
1082@@ -15,9 +15,11 @@
1083 */
1084
1085 import QtQuick 2.4
1086-import Ubuntu.Components 1.2
1087-import Ubuntu.Components.Popups 1.0
1088+import Ubuntu.Components 1.3
1089+import QtQuick.Layouts 1.1
1090+import Ubuntu.Components.Popups 1.3
1091 import DocumentViewer.LibreOffice 1.0 as LibreOffice
1092+import DocumentViewer 1.0
1093
1094 PageHeadState {
1095 id: rootItem
1096@@ -25,14 +27,16 @@
1097 property Page targetPage
1098 head: targetPage.head
1099
1100- contents: Column {
1101- anchors {
1102- left: parent.left
1103- right: parent.right
1104- verticalCenter: parent.verticalCenter
1105- }
1106-
1107- Label {
1108+ contents: RowLayout {
1109+ anchors.fill: parent
1110+ anchors.rightMargin: units.gu(2)
1111+ spacing: units.gu(1)
1112+
1113+ Column {
1114+ id: layout
1115+ Layout.fillWidth: true
1116+
1117+ Label {
1118 anchors { left: parent.left; right: parent.right }
1119 elide: Text.ElideMiddle
1120 font.weight: Font.DemiBold
1121@@ -41,7 +45,7 @@
1122 Label {
1123 anchors { left: parent.left; right: parent.right }
1124 elide: Text.ElideMiddle
1125- fontSize: "small"
1126+ textSize: Label.Small
1127 text: {
1128 if (!loPageContentLoader.item)
1129 return i18n.tr("Loading...")
1130@@ -59,33 +63,30 @@
1131 return i18n.tr("Unknown LibreOffice document")
1132 default:
1133 return i18n.tr("Unknown type document")
1134+ }
1135 }
1136 }
1137 }
1138- }
1139-
1140-
1141- backAction: Action {
1142- iconName: "back"
1143- text: (pageStack.depth > 1) ? i18n.tr("Back") : i18n.tr("Close")
1144- onTriggered: {
1145- if (pageStack.depth > 1) {
1146- // Go back to Welcome page
1147- pageStack.pop();
1148- } else {
1149- // File has been imported through Content Hub (or was not chosen through WelcomePage)
1150- // Close the application and show our source app (e.g. ubuntu-filemanager-app, if used to open a document)
1151- Qt.quit()
1152+
1153+ ZoomSelector {
1154+ Layout.preferredWidth: units.gu(12)
1155+ Layout.preferredHeight: units.gu(4)
1156+
1157+ visible: {
1158+ if (!loPageContentLoader.item)
1159+ return false
1160+
1161+ return DocumentViewer.desktopMode || targetPage.width > units.gu(80)
1162 }
1163 }
1164 }
1165
1166 actions: [
1167- Action {
1168- iconName: "zoom-in"
1169- text: i18n.tr("Show zoom controls")
1170- onTriggered: targetPage.state = "zoom"
1171- },
1172+ /* Action {
1173+ iconName: "Search"
1174+ text: i18n.tr("Search")
1175+ enabled: false
1176+ },*/
1177
1178 Action {
1179 objectName: "gotopage"
1180
1181=== modified file 'src/app/qml/loView/LOViewGotoDialog.qml'
1182--- src/app/qml/loView/LOViewGotoDialog.qml 2015-10-19 11:30:01 +0000
1183+++ src/app/qml/loView/LOViewGotoDialog.qml 2015-11-27 16:47:37 +0000
1184@@ -15,8 +15,8 @@
1185 */
1186
1187 import QtQuick 2.4
1188-import Ubuntu.Components 1.2
1189-import Ubuntu.Components.Popups 1.0
1190+import Ubuntu.Components 1.3
1191+import Ubuntu.Components.Popups 1.3
1192 import QtQuick.Layouts 1.1
1193
1194 // TODO: Use page breaks detection, when LibreOfficeKit will support it.
1195
1196=== modified file 'src/app/qml/loView/LOViewPage.qml'
1197--- src/app/qml/loView/LOViewPage.qml 2015-11-21 19:41:04 +0000
1198+++ src/app/qml/loView/LOViewPage.qml 2015-11-27 16:47:37 +0000
1199@@ -15,32 +15,22 @@
1200 */
1201
1202 import QtQuick 2.4
1203-import Ubuntu.Components 1.2
1204+import Ubuntu.Components 1.3
1205 import Ubuntu.Layouts 1.0
1206 import DocumentViewer.LibreOffice 1.0 as LibreOffice
1207
1208-import "../upstreamComponents"
1209-
1210+import "../common"
1211 import "../common/utils.js" as Utils
1212 import "../common"
1213 import "KeybHelper.js" as KeybHelper
1214
1215-PageWithBottomEdge {
1216+Page {
1217 id: loPage
1218- title: Utils.getNameOfFile(file.path);
1219+ title: Utils.getNameOfFile(file.path)
1220 flickable: null
1221
1222 readonly property bool wideWindow: width > units.gu(120)
1223
1224- bottomEdgeTitle: i18n.tr("Slides")
1225- bottomEdgeEnabled: {
1226- if (!loPageContentLoader.loaded)
1227- return false
1228-
1229- // else
1230- return loPageContentLoader.item.loDocument.documentType == LibreOffice.Document.PresentationDocument && !wideWindow
1231- }
1232-
1233 Loader {
1234 id: loPageContentLoader
1235
1236@@ -53,12 +43,7 @@
1237 // FIXME: At the moment don't hide header if the document is a presentation
1238 var isPresentation = (item.loDocument.documentType === LibreOffice.Document.PresentationDocument)
1239 loPage.flickable = isPresentation ? null : item.loView
1240-
1241- loPage.bottomEdgePageComponent = item.bottomEdgePartsPage
1242-
1243- } else {
1244- loPage.flickable = null
1245- }
1246+ } else loPage.flickable = null
1247 }
1248 }
1249
1250@@ -77,7 +62,6 @@
1251
1252 property alias loDocument: loView.document
1253 property alias loView: loView
1254- property alias bottomEdgePartsPage: bottomEdgePartsPage
1255
1256 Layouts {
1257 id: layouts
1258@@ -91,50 +75,29 @@
1259 Item {
1260 anchors.fill: parent
1261
1262- // TODO: Add a setting to show/hide sidebar when width > units.gu(80)
1263- PartsView {
1264- id: partsView
1265- anchors {
1266- top: parent.top
1267- bottom: bottomBarLayoutItem.top
1268- left: parent.left
1269- }
1270-
1271- model: loView.partsModel
1272+ ResizeableSidebar {
1273+ id: leftSidebar
1274+ anchors.left: parent.left
1275+ anchors.bottom: parent.bottom
1276 visible: loDocument.documentType == LibreOffice.Document.PresentationDocument
1277+
1278 width: visible ? units.gu(40) : 0
1279- }
1280-
1281- Item {
1282- anchors {
1283- left: partsView.right
1284- right: parent.right
1285- top: parent.top
1286- bottom: bottomBarLayoutItem.top
1287- }
1288-
1289- ItemLayout {
1290- item: "pinchArea"
1291+
1292+ PartsView {
1293+ id: partsView
1294 anchors.fill: parent
1295-
1296- // Keyboard events
1297- focus: true
1298- Keys.onPressed: KeybHelper.parseEvent(event)
1299- Component.onCompleted: loPageContent.forceActiveFocus()
1300+ model: loView.partsModel
1301 }
1302 }
1303
1304- Item {
1305- id: bottomBarLayoutItem
1306- visible: loDocument.documentType == LibreOffice.Document.PresentationDocument
1307- height: visible ? units.gu(5) : 0
1308+ ItemLayout {
1309+ item: "pinchArea"
1310 anchors {
1311- left: parent.left
1312+ left: leftSidebar.right
1313 right: parent.right
1314+ top: parent.top
1315 bottom: parent.bottom
1316 }
1317-
1318- ItemLayout { item: "bottomBar"; anchors.fill: parent }
1319 }
1320 }
1321 }
1322@@ -158,13 +121,15 @@
1323 LibreOffice.Viewer {
1324 id: loView
1325 objectName: "loView"
1326- Layouts.item: "loView"
1327-
1328 anchors.fill: parent
1329
1330 clip: true
1331 documentPath: file.path
1332
1333+ function updateContentSize(tgtScale) {
1334+ zoomFactor = tgtScale
1335+ }
1336+
1337 // Keyboard events
1338 focus: true
1339 Keys.onPressed: KeybHelper.parseEvent(event)
1340@@ -176,10 +141,6 @@
1341 loPageContent.forceActiveFocus()
1342 }
1343
1344- function updateContentSize(tgtScale) {
1345- zoomFactor = tgtScale
1346- }
1347-
1348 onErrorChanged: {
1349 var errorString;
1350
1351@@ -210,37 +171,25 @@
1352 }
1353 }
1354
1355- // TODO: When we'll have to merge this with the zooming branch, replace this
1356- // and use a single bottom panel
1357- SlideControllerPanel {
1358+ PartsView {
1359 id: bottomBar
1360- Layouts.item: "bottomBar"
1361+ anchors {
1362+ left: parent.left
1363+ right: parent.right
1364+ bottom: parent.bottom
1365+ }
1366+ height: visible ? units.gu(12) : 0
1367 visible: loDocument.documentType == LibreOffice.Document.PresentationDocument
1368- height: visible ? units.gu(5) : 0
1369- anchors {
1370- left: parent.left
1371- right: parent.right
1372- bottom: parent.bottom
1373- }
1374- }
1375- }
1376-
1377- Component {
1378- id: bottomEdgePartsPage
1379- Page {
1380- title: i18n.tr("Slides")
1381- head.backAction: Action {
1382- text: i18n.tr("Back")
1383- iconName: "down"
1384- onTriggered: pageStack.pop()
1385- }
1386-
1387- flickable: null
1388-
1389- PartsView {
1390- property bool belongsToNestedPage: true
1391- anchors.fill: parent
1392- model: loView.partsModel
1393+
1394+ model: loView.partsModel
1395+ orientation: ListView.Horizontal
1396+
1397+ HorizontalDivider {
1398+ anchors {
1399+ left: parent.left
1400+ right: parent.right
1401+ top: parent.top
1402+ }
1403 }
1404 }
1405 }
1406@@ -253,11 +202,6 @@
1407 LOViewDefaultHeader {
1408 name: "default"
1409 targetPage: loPage
1410- },
1411-
1412- LOViewZoomHeader {
1413- name: "zoom"
1414- targetPage: loPage
1415 }
1416 ]
1417 }
1418
1419=== removed file 'src/app/qml/loView/LOViewZoomHeader.qml'
1420--- src/app/qml/loView/LOViewZoomHeader.qml 2015-10-19 11:44:11 +0000
1421+++ src/app/qml/loView/LOViewZoomHeader.qml 1970-01-01 00:00:00 +0000
1422@@ -1,59 +0,0 @@
1423-/*
1424- * Copyright (C) 2014-2015 Canonical, Ltd.
1425- *
1426- * This program is free software; you can redistribute it and/or modify
1427- * it under the terms of the GNU General Public License as published by
1428- * the Free Software Foundation; version 3.
1429- *
1430- * This program is distributed in the hope that it will be useful,
1431- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1432- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1433- * GNU General Public License for more details.
1434- *
1435- * You should have received a copy of the GNU General Public License
1436- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1437- */
1438-
1439-import QtQuick 2.4
1440-import Ubuntu.Components 1.2
1441-import QtQuick.Layouts 1.1
1442-import Ubuntu.Components.Popups 1.0
1443-
1444-PageHeadState {
1445- id: rootItem
1446-
1447- property Page targetPage
1448- head: targetPage.head
1449-
1450- contents: Item {
1451- anchors.fill: parent
1452-
1453- ZoomSelector {
1454- width: units.gu(24)
1455- anchors {
1456- right: parent.right
1457- verticalCenter: parent.verticalCenter
1458- }
1459- }
1460- }
1461-
1462- backAction: Action {
1463- iconName: "close"
1464- text: i18n.tr("Hide zoom controls")
1465- onTriggered: targetPage.state = "default"
1466- }
1467-
1468- actions: [
1469- Action {
1470- iconName: "zoom-in"
1471- text: i18n.tr("Zoom in")
1472- onTriggered: loPageContentLoader.item.loView.zoomFactor += 0.1
1473- },
1474-
1475- Action {
1476- iconName: "zoom-out"
1477- text: i18n.tr("Zoom out")
1478- onTriggered: loPageContentLoader.item.loView.zoomFactor -= 0.1
1479- }
1480- ]
1481-}
1482
1483=== modified file 'src/app/qml/loView/PanelButton.qml'
1484--- src/app/qml/loView/PanelButton.qml 2015-10-19 11:44:11 +0000
1485+++ src/app/qml/loView/PanelButton.qml 2015-11-27 16:47:37 +0000
1486@@ -15,7 +15,7 @@
1487 */
1488
1489 import QtQuick 2.4
1490-import Ubuntu.Components 1.2
1491+import Ubuntu.Components 1.3
1492
1493 AbstractButton {
1494 width: units.gu(4); height: parent.height
1495
1496=== modified file 'src/app/qml/loView/PartsView.qml'
1497--- src/app/qml/loView/PartsView.qml 2015-10-19 11:44:11 +0000
1498+++ src/app/qml/loView/PartsView.qml 2015-11-27 16:47:37 +0000
1499@@ -15,7 +15,7 @@
1500 */
1501
1502 import QtQuick 2.4
1503-import Ubuntu.Components 1.2
1504+import Ubuntu.Components 1.3
1505 import QtQuick.Layouts 1.1
1506 import DocumentViewer.LibreOffice 1.0 as LibreOffice
1507
1508@@ -26,66 +26,120 @@
1509
1510 property bool expanded: true
1511
1512+ orientation: ListView.Vertical
1513+
1514+ // used in vertical mode
1515+ property bool isWide: width > units.gu(24)
1516+
1517 currentIndex: view.model ? loView.document.currentPart : -1
1518 highlightMoveDuration: UbuntuAnimation.SnapDuration
1519
1520- delegate: ListItem {
1521- id: delegate
1522-
1523- width: parent.width
1524- height: units.gu(16)
1525-
1526- color: (loView.document.currentPart === model.index) ? Theme.palette.selected.background
1527- : "transparent"
1528-
1529- AbstractButton {
1530- objectName: "abstractbutton"
1531- anchors.fill: parent
1532-
1533- onClicked: {
1534- loView.document.currentPart = model.index
1535-
1536- // Check if the view has been included in a nested page (e.g.
1537- // bottomEdge). If so, close that page and return to the
1538- // main viewer.
1539- if (view.hasOwnProperty("belongsToNestedPage"))
1540- pageStack.pop();
1541- }
1542- }
1543-
1544- RowLayout {
1545- anchors {
1546- fill: parent
1547- leftMargin: units.gu(1)
1548- rightMargin: units.gu(1)
1549- }
1550- spacing: units.gu(1)
1551-
1552- Image {
1553- Layout.fillHeight: true
1554- Layout.preferredWidth: height
1555- fillMode: Image.PreserveAspectFit
1556- // Do not store a cache of the thumbnail, so that we don't show
1557- // thumbnails of a previously loaded document.
1558- cache: true // TODO PLAY WITH IT
1559- source: model.thumbnail
1560- }
1561-
1562- Label {
1563- Layout.fillWidth: true
1564- wrapMode: Text.WordWrap
1565- text: model.name
1566- color: (loView.document.currentPart === model.index) ? UbuntuColors.orange
1567- : Theme.palette.selected.backgroundText
1568- }
1569-
1570- Label {
1571- text: model.index + 1
1572- color: (loView.document.currentPart === model.index) ? UbuntuColors.orange
1573- : Theme.palette.selected.backgroundText
1574- }
1575- }
1576- }
1577+ delegate: (orientation == ListView.Vertical) ? verticalDelegate : horizontalDelegate
1578+
1579+ Component {
1580+ id: verticalDelegate
1581+
1582+ ListItem {
1583+ id: delegate
1584+ width: parent.width
1585+ height: units.gu(16)
1586+
1587+ color: (loView.document.currentPart === model.index) ? theme.palette.selected.background
1588+ : "transparent"
1589+
1590+ onClicked: internal.delegate_onClicked(model.index)
1591+
1592+ RowLayout {
1593+ anchors {
1594+ fill: parent
1595+ leftMargin: units.gu(1)
1596+ rightMargin: units.gu(1)
1597+ }
1598+ spacing: units.gu(1)
1599+
1600+ Image {
1601+ Layout.fillHeight: true
1602+ Layout.preferredWidth: height
1603+ fillMode: Image.PreserveAspectFit
1604+ // Do not store a cache of the thumbnail, so that we don't show
1605+ // thumbnails of a previously loaded document.
1606+ cache: true // TODO PLAY WITH IT
1607+ source: model.thumbnail
1608+ }
1609+
1610+ Label {
1611+ Layout.fillWidth: true
1612+ wrapMode: Text.WordWrap
1613+ text: model.name
1614+ visible: view.isWide
1615+ color: (loView.document.currentPart === model.index) ? UbuntuColors.orange
1616+ : theme.palette.selected.backgroundText
1617+ }
1618+
1619+ Label {
1620+ text: model.index + 1
1621+ color: (loView.document.currentPart === model.index) ? UbuntuColors.orange
1622+ : theme.palette.selected.backgroundText
1623+ }
1624+ }
1625+ }
1626+ }
1627+
1628+ Component {
1629+ id: horizontalDelegate
1630+
1631+ ListItem {
1632+ id: delegate
1633+ height: parent.height; width: height
1634+
1635+ color: (loView.document.currentPart === model.index) ? theme.palette.selected.background
1636+ : "transparent"
1637+
1638+ onClicked: internal.delegate_onClicked(model.index)
1639+
1640+ ColumnLayout {
1641+ anchors {
1642+ fill: parent
1643+ topMargin: units.gu(1)
1644+ leftMargin: units.gu(2)
1645+ rightMargin: units.gu(2)
1646+ }
1647+ spacing: units.gu(0.5)
1648+
1649+ Image {
1650+ Layout.fillWidth: true
1651+ Layout.preferredHeight: width
1652+ fillMode: Image.PreserveAspectFit
1653+ // Do not store a cache of the thumbnail, so that we don't show
1654+ // thumbnails of a previously loaded document.
1655+ cache: true // TODO PLAY WITH IT
1656+ source: model.thumbnail
1657+ }
1658+
1659+ Label {
1660+ Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
1661+ text: model.index + 1
1662+ color: (loView.document.currentPart === model.index) ? UbuntuColors.orange
1663+ : theme.palette.selected.backgroundText
1664+ }
1665+ }
1666+ }
1667+ }
1668+
1669+ QtObject {
1670+ id: internal
1671+
1672+ function delegate_onClicked(index) {
1673+ loView.document.currentPart = index
1674+
1675+ // Check if the view has been included in a nested page (e.g.
1676+ // bottomEdge). If so, close that page and return to the
1677+ // main viewer.
1678+ if (view.hasOwnProperty("belongsToNestedPage"))
1679+ pageStack.pop();
1680+ }
1681+ }
1682+
1683
1684 Scrollbar { flickableItem: view; parent: view.parent }
1685 }
1686
1687=== removed file 'src/app/qml/loView/SlideControllerPanel.qml'
1688--- src/app/qml/loView/SlideControllerPanel.qml 2015-10-19 11:44:11 +0000
1689+++ src/app/qml/loView/SlideControllerPanel.qml 1970-01-01 00:00:00 +0000
1690@@ -1,87 +0,0 @@
1691-/*
1692- * Copyright (C) 2015 Stefano Verzegnassi
1693- *
1694- * This program is free software; you can redistribute it and/or modify
1695- * it under the terms of the GNU General Public License as published by
1696- * the Free Software Foundation; version 3.
1697- *
1698- * This program is distributed in the hope that it will be useful,
1699- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1700- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1701- * GNU General Public License for more details.
1702- *
1703- * You should have received a copy of the GNU General Public License
1704- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1705- */
1706-
1707-import QtQuick 2.4
1708-import Ubuntu.Components 1.2
1709-import QtQuick.Layouts 1.1
1710-import Ubuntu.Components.ListItems 1.0 as ListItems
1711-
1712-Rectangle {
1713- id: bottomBar
1714- color: "transparent"
1715- height: units.gu(5)
1716-
1717- ListItems.ThinDivider {
1718- anchors {
1719- top: parent.top
1720- left: parent.left
1721- right: parent.right
1722- }
1723- }
1724-
1725- Row {
1726- anchors.centerIn: parent
1727- //spacing: units.gu(2)
1728-
1729- AbstractButton {
1730- width: units.gu(4); height: parent.height
1731- onClicked: loPageContentLoader.item.loView.goFirstPart()
1732-
1733- Icon {
1734- anchors.centerIn: parent
1735- width: units.gu(2.5); height: width
1736- name: "go-first"
1737- }
1738- }
1739-
1740- AbstractButton {
1741- width: units.gu(4); height: parent.height
1742- onClicked: loPageContentLoader.item.loView.goPreviousPart()
1743-
1744- Icon {
1745- anchors.centerIn: parent
1746- width: units.gu(2.5); height: width
1747- name: "go-previous"
1748- }
1749- }
1750-
1751- Label {
1752- text: i18n.tr("Slide %1 of %2").arg(loPageContentLoader.item.loDocument.currentPart + 1).arg(loPageContentLoader.item.loDocument.partsCount)
1753- }
1754-
1755- AbstractButton {
1756- width: units.gu(4); height: parent.height
1757- onClicked: loPageContentLoader.item.loView.goNextPart()
1758-
1759- Icon {
1760- anchors.centerIn: parent
1761- width: units.gu(2.5); height: width
1762- name: "go-next"
1763- }
1764- }
1765-
1766- AbstractButton {
1767- width: units.gu(4); height: parent.height
1768- onClicked: loPageContentLoader.item.loView.goLastPart()
1769-
1770- Icon {
1771- anchors.centerIn: parent
1772- width: units.gu(2.5); height: width
1773- name: "go-last"
1774- }
1775- }
1776- }
1777-}
1778
1779=== modified file 'src/app/qml/loView/ZoomSelector.qml'
1780--- src/app/qml/loView/ZoomSelector.qml 2015-10-19 11:44:11 +0000
1781+++ src/app/qml/loView/ZoomSelector.qml 2015-11-27 16:47:37 +0000
1782@@ -1,5 +1,5 @@
1783 /*
1784- * Copyright (C) 2015 Canonical, Ltd.
1785+ * Copyright (C) 2015 Stefano Verzegnassi
1786 *
1787 * This program is free software; you can redistribute it and/or modify
1788 * it under the terms of the GNU General Public License as published by
1789@@ -15,135 +15,150 @@
1790 */
1791
1792 import QtQuick 2.4
1793-import Ubuntu.Components 1.2
1794-import Ubuntu.Components.Popups 1.0
1795+import Ubuntu.Components 1.3
1796+import QtQuick.Layouts 1.1
1797 import DocumentViewer.LibreOffice 1.0 as LibreOffice
1798
1799-TextField {
1800+import "../common"
1801+
1802+TextFieldWithButton {
1803 id: textField
1804 anchors.verticalCenter: parent.verticalCenter
1805- width: units.gu(24)
1806-
1807- property var values: ["auto", 0.5, 0.7, 0.85, 1.0, 1.25, 1.5, 1.75, 2.0, 3.0, 4.0]
1808- property var labels: [
1809- i18n.tr("Automatic (Fit width)"),
1810- "50%", "70%", "85%", "100%", "125%",
1811- "150%", "175%","200%", "300%", "400%"
1812- ]
1813-
1814- property bool expanded: false
1815+ width: units.gu(12)
1816+
1817+ property var view: loPageContentLoader.item.loView
1818
1819 hasClearButton: true
1820 inputMethodHints: Qt.ImhFormattedNumbersOnly
1821- validator: IntValidator{ bottom: 50; top: 400 }
1822+ validator: IntValidator { bottom: 50; top: 400 }
1823
1824 onAccepted: {
1825- loPageContentLoader.item.loView.zoomFactor = parseInt(text) / 100
1826+ view.setZoom(parseInt(text) / 100)
1827 focus = false
1828 }
1829
1830- secondaryItem: AbstractButton {
1831- visible: !textField.highlighted
1832- id: listButton
1833- height: parent.height
1834- width: visible ? height : 0
1835-
1836- Rectangle {
1837- anchors.left: parent.left
1838- anchors.verticalCenter: parent.verticalCenter
1839- height: parent.height - units.gu(1)
1840-
1841- width: units.dp(1)
1842- color: "Grey"
1843- opacity: 0.5
1844- }
1845-
1846- Icon {
1847- id: _upArrow
1848-
1849- width: units.gu(2)
1850- height: width
1851- anchors.centerIn: parent
1852-
1853- name: "go-down"
1854- color: "Grey"
1855- rotation: textField.expanded ? 180 : 0
1856-
1857- Behavior on rotation {
1858- UbuntuNumberAnimation {}
1859- }
1860- }
1861-
1862- onClicked: {
1863- textField.expanded = true
1864- PopupUtils.open(zoomSelectorDialog, listButton)
1865- }
1866- }
1867-
1868 onHighlightedChanged: {
1869 if (highlighted) {
1870- text = parseInt(loPageContentLoader.item.loView.zoomFactor * 100)
1871+ text = parseInt(view.zoomFactor * 100)
1872 } else text = ""
1873 }
1874
1875 Label {
1876- anchors.verticalCenter: parent.verticalCenter
1877- anchors.left: parent.left
1878- anchors.leftMargin: units.gu(2)
1879+ anchors.centerIn: parent
1880 visible: !textField.highlighted
1881- text: loPageContentLoader.item.loView.zoomMode == LibreOffice.View.FitToWidth ? i18n.tr("Automatic (%1%)").arg(parseInt(loPageContentLoader.item.loView.zoomFactor*100))
1882- : i18n.tr("Zoom: %1%").arg(parseInt(loPageContentLoader.item.loView.zoomFactor*100))
1883- }
1884-
1885- Component {
1886- id: zoomSelectorDialog
1887- Popover {
1888- id: zoomSelectorDialogue
1889- autoClose: false
1890- contentHeight: units.gu(24)
1891- contentWidth: units.gu(24)
1892- Component.onDestruction: textField.expanded = false
1893-
1894- // We don't use 'autoClose' property, since we want to propagate
1895- // mouse/touch events to other items (e.g. when zoomSelectorDialogue
1896- // is visible, and user taps the zoom+ button on its right, we want
1897- // the zoom button to receive the event).
1898- InverseMouseArea {
1899- anchors.fill: parent
1900- propagateComposedEvents: true
1901-
1902- onPressed: {
1903- mouse.accepted = false
1904- PopupUtils.close(zoomSelectorDialogue)
1905- }
1906- }
1907-
1908- OptionSelector {
1909- expanded: true
1910- width: parent.width
1911- containerHeight: units.gu(24)
1912- model: textField.labels
1913- selectedIndex: {
1914- if (loPageContentLoader.item.loView.zoomMode == LibreOffice.View.FitToWidth)
1915- return 0
1916-
1917- for (var i=0; i<textField.values.length; i++) {
1918- if (values[i] == loView.zoomFactor)
1919- return i
1920- }
1921- return -1
1922- }
1923-
1924- onSelectedIndexChanged: {
1925- if (selectedIndex == 0) {
1926- loView.adjustZoomToWidth();
1927- return;
1928- }
1929-
1930- loPageContentLoader.item.loView.zoomFactor = textField.values[selectedIndex]
1931- PopupUtils.close(zoomSelectorDialogue)
1932- }
1933- }
1934- }
1935- }
1936-}
1937+ text: "%1%".arg(parseInt(view.zoomFactor*100))
1938+ }
1939+
1940+ popover: TextFieldButtonPopover {
1941+ id: zoomSelectorDialogue
1942+
1943+ RowLayout {
1944+ anchors { left: parent.left; right: parent.right }
1945+ height: units.gu(4)
1946+ spacing: units.gu(1)
1947+
1948+ ListItem {
1949+ divider.visible: false
1950+ Layout.fillHeight: true
1951+ Layout.fillWidth: true
1952+
1953+ onClicked: {
1954+ var view = loPageContentLoader.item.loView
1955+ view.setZoom(view.zoomFactor + 0.1)
1956+ }
1957+
1958+ Icon {
1959+ width: units.gu(2); height: width
1960+ anchors.centerIn: parent
1961+ name: "zoom-in"
1962+ }
1963+ }
1964+
1965+ VerticalDivider {
1966+ Layout.fillHeight: true
1967+ Layout.preferredWidth: units.dp(2)
1968+ }
1969+
1970+ ListItem {
1971+ divider.visible: false
1972+ Layout.fillHeight: true
1973+ Layout.fillWidth: true
1974+
1975+ onClicked: {
1976+ var view = loPageContentLoader.item.loView
1977+ view.setZoom(view.zoomFactor - 0.1)
1978+ }
1979+
1980+ Icon {
1981+ width: units.gu(2); height: width
1982+ anchors.centerIn: parent
1983+ name: "zoom-out"
1984+ }
1985+ }
1986+ } // RowLayout
1987+
1988+ HorizontalDivider { anchors { left: parent.left; right: parent.right } }
1989+
1990+ ListItem {
1991+ height: units.gu(4)
1992+ divider.visible: false
1993+
1994+ onClicked: {
1995+ view.adjustZoomToWidth()
1996+ zoomSelectorDialogue.close()
1997+ }
1998+
1999+ /* UITK 1.3 specs: Two slot layout (A-B) */
2000+ ListItemLayout {
2001+ anchors.centerIn: parent
2002+
2003+ /* UITK 1.3 specs: Slot A */
2004+ title.text: i18n.tr("Fit width")
2005+
2006+ /* UITK 1.3 specs: Slot B */
2007+ Icon {
2008+ SlotsLayout.position: SlotsLayout.Last
2009+ width: units.gu(2); height: width
2010+ name: "tick"
2011+ color: UbuntuColors.green
2012+ visible: view.zoomMode == LibreOffice.View.FitToWidth
2013+ }
2014+ }
2015+ } // ListItem
2016+
2017+ HorizontalDivider { anchors { left: parent.left; right: parent.right } }
2018+
2019+ Repeater {
2020+ model: [
2021+ { text: "50%", value: 0.50 },
2022+ { text: "70%", value: 0.70 },
2023+ { text: "85%", value: 0.85 },
2024+ { text: "100%", value: 1.00 },
2025+ { text: "125%", value: 1.25 },
2026+ { text: "150%", value: 1.50 },
2027+ { text: "175%", value: 1.75 },
2028+ { text: "200%", value: 2.00 },
2029+ { text: "300%", value: 3.00 },
2030+ { text: "400%", value: 4.00 }
2031+ ]
2032+
2033+ ListItem {
2034+ divider.visible: false
2035+ height: units.gu(4)
2036+
2037+ onClicked: {
2038+ view.setZoom(modelData.value)
2039+ zoomSelectorDialogue.close()
2040+ }
2041+
2042+ Label {
2043+ text: modelData.text
2044+ anchors {
2045+ left: parent.left; leftMargin: units.gu(1)
2046+ verticalCenter: parent.verticalCenter
2047+ }
2048+ }
2049+ }
2050+ } // Repeater
2051+ } // zoomSelectorDialogue
2052+} // textField
2053
2054=== modified file 'src/app/qml/pdfView/PdfContentsPage.qml'
2055--- src/app/qml/pdfView/PdfContentsPage.qml 2015-10-10 12:03:30 +0000
2056+++ src/app/qml/pdfView/PdfContentsPage.qml 2015-11-27 16:47:37 +0000
2057@@ -16,11 +16,9 @@
2058 */
2059
2060 import QtQuick 2.4
2061-import Ubuntu.Components 1.2
2062+import Ubuntu.Components 1.3
2063 import QtQuick.Layouts 1.1
2064
2065-import "../upstreamComponents"
2066-
2067 Page {
2068 id: pdfContents
2069 objectName: "pdfcontents"
2070@@ -41,9 +39,6 @@
2071 }
2072
2073 onActiveChanged: {
2074- // If the header was hidden in the PdfPage, make it visible.
2075- mainView.setHeaderVisibility(true);
2076-
2077 // Find out the current page position in the ToC index
2078 for (var i=0; i<poppler.tocModel.count; i++) {
2079 if (i+1 < poppler.tocModel.count) {
2080@@ -111,7 +106,7 @@
2081
2082 font.weight: model.level == 0 ? Font.DemiBold : Font.Normal
2083 color: (model.level == 0) ? UbuntuColors.midAubergine
2084- : Theme.palette.selected.backgroundText
2085+ : theme.palette.selected.backgroundText
2086 }
2087
2088 /*
2089@@ -134,7 +129,7 @@
2090 text: model.pageIndex + 1
2091 font.weight: model.level == 0 ? Font.DemiBold : Font.Normal
2092 color: (model.level == 0) ? UbuntuColors.midAubergine
2093- : Theme.palette.selected.backgroundText
2094+ : theme.palette.selected.backgroundText
2095 }
2096 }
2097 }
2098
2099=== modified file 'src/app/qml/pdfView/PdfView.qml'
2100--- src/app/qml/pdfView/PdfView.qml 2015-10-20 18:21:17 +0000
2101+++ src/app/qml/pdfView/PdfView.qml 2015-11-27 16:47:37 +0000
2102@@ -15,19 +15,19 @@
2103 */
2104
2105 import QtQuick 2.4
2106-import Ubuntu.Components 1.2
2107+import Ubuntu.Components 1.3
2108 import DocumentViewer.PDF 1.0 as PDF
2109
2110+import "../common"
2111 import "../common/utils.js" as Utils
2112-import "../upstreamComponents"
2113+
2114+// TODO: Use UITK 1.3 BottomEdge component when available
2115
2116 PageWithBottomEdge {
2117 id: pdfPage
2118- title: Utils.getNameOfFile(file.path);
2119+ title: Utils.getNameOfFile(file.path)
2120
2121- // Disable header auto-hide.
2122- // TODO: Show/hide header if a user taps the page
2123- flickable: null
2124+ flickable: pdfView
2125
2126 // TRANSLATORS: the first argument (%1) refers to the page currently shown on the screen,
2127 // while the second one (%2) refers to the total pages count.
2128@@ -35,19 +35,37 @@
2129
2130 // TRANSLATORS: "Contents" refers to the "Table of Contents" of a PDF document.
2131 bottomEdgeTitle: i18n.tr("Contents")
2132- bottomEdgePageComponent: PdfContentsPage {}
2133+ bottomEdgePageComponent: PdfContentsPage { }
2134 bottomEdgeEnabled: poppler.tocModel.count > 0
2135
2136 // Reset night mode shader settings when closing the page
2137 // Component.onDestruction: mainView.nightModeEnabled = false
2138
2139+ Rectangle {
2140+ // Since UITK 1.3, the MainView background is white.
2141+ // We need to set a different color, otherwise pages
2142+ // boundaries are not visible.
2143+ anchors.fill: parent
2144+ color: "#f5f5f5"
2145+ }
2146+
2147 PDF.VerticalView {
2148 id: pdfView
2149 objectName: "pdfView"
2150- anchors.fill: parent
2151+
2152+ anchors {
2153+ fill: parent
2154+
2155+ // WORKAROUND: If we set 'pdfPage.flickable' property, 'pdfView' is not
2156+ // longer aligned to the bottom of the header, but to the top instead.
2157+ // This is deprecated code though, and it's not worth to spend more time
2158+ // for a proper fix here.
2159+ // (This is likely a bug in the VerticalView class.)
2160+ topMargin: units.gu(6)
2161+ }
2162+
2163 spacing: units.gu(2)
2164
2165- clip: true
2166 boundsBehavior: Flickable.StopAtBounds
2167 flickDeceleration: 1500 * units.gridUnit / 8
2168 maximumFlickVelocity: 2500 * units.gridUnit / 8
2169@@ -80,18 +98,12 @@
2170 // but it's not a problem at the moment (our target is phone).
2171 window.releaseResources();
2172 }
2173-
2174- MouseArea {
2175- objectName: "mouseArea"
2176-
2177- anchors.fill: parent
2178- onClicked: mainView.toggleHeaderVisibility()
2179- }
2180 }
2181
2182 Item { id: _zoomHelper }
2183 }
2184
2185+
2186 Scrollbar { flickableItem: pdfView }
2187 Scrollbar { flickableItem: pdfView; align: Qt.AlignBottom }
2188
2189@@ -107,9 +119,6 @@
2190 var title = getDocumentInfo("Title")
2191 if (title !== "")
2192 pdfPage.title = title;
2193-
2194- // Hide header when the document is ready
2195- mainView.setHeaderVisibility(false);
2196 }
2197 }
2198
2199
2200=== modified file 'src/app/qml/pdfView/PdfViewDefaultHeader.qml'
2201--- src/app/qml/pdfView/PdfViewDefaultHeader.qml 2015-10-10 12:03:30 +0000
2202+++ src/app/qml/pdfView/PdfViewDefaultHeader.qml 2015-11-27 16:47:37 +0000
2203@@ -15,9 +15,10 @@
2204 */
2205
2206 import QtQuick 2.4
2207-import Ubuntu.Components 1.2
2208+import Ubuntu.Components 1.3
2209 import QtQuick.Layouts 1.1
2210-import Ubuntu.Components.Popups 1.0
2211+import Ubuntu.Components.Popups 1.3
2212+import DocumentViewer 1.0
2213
2214 PageHeadState {
2215 id: rootItem
2216@@ -31,7 +32,7 @@
2217 anchors.fill: parent
2218 spacing: units.gu(1)
2219
2220- ActivityIndicator { id: activity }
2221+ ActivityIndicator { id: activity; visible: running }
2222
2223 Column {
2224 id: layout
2225@@ -50,27 +51,12 @@
2226 //horizontalAlignment: Text.AlignHCenter
2227 elide: Text.ElideMiddle
2228
2229- fontSize: "small"
2230+ textSize: Label.Small
2231 text: targetPage.currentPage
2232 }
2233 }
2234 }
2235
2236- backAction: Action {
2237- iconName: "back"
2238- text: (pageStack.depth > 1) ? i18n.tr("Back") : i18n.tr("Close")
2239- onTriggered: {
2240- if (pageStack.depth > 1) {
2241- // Go back to Welcome page
2242- pageStack.pop();
2243- } else {
2244- // File has been imported through Content Hub (or was not chosen through WelcomePage)
2245- // Close the application and show our source app (e.g. ubuntu-filemanager-app, if used to open a document)
2246- Qt.quit()
2247- }
2248- }
2249- }
2250-
2251 actions: [
2252 Action {
2253 iconName: "search"
2254
2255=== modified file 'src/app/qml/pdfView/PdfViewDelegate.qml'
2256--- src/app/qml/pdfView/PdfViewDelegate.qml 2015-10-10 12:03:30 +0000
2257+++ src/app/qml/pdfView/PdfViewDelegate.qml 2015-11-27 16:47:37 +0000
2258@@ -14,7 +14,7 @@
2259 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2260 */
2261 import QtQuick 2.4
2262-import Ubuntu.Components 1.2
2263+import Ubuntu.Components 1.3
2264
2265 Rectangle {
2266 id: pdfPage
2267
2268=== modified file 'src/app/qml/pdfView/PdfViewGotoDialog.qml'
2269--- src/app/qml/pdfView/PdfViewGotoDialog.qml 2015-10-10 12:03:30 +0000
2270+++ src/app/qml/pdfView/PdfViewGotoDialog.qml 2015-11-27 16:47:37 +0000
2271@@ -15,8 +15,8 @@
2272 */
2273
2274 import QtQuick 2.4
2275-import Ubuntu.Components 1.2
2276-import Ubuntu.Components.Popups 1.0
2277+import Ubuntu.Components 1.3
2278+import Ubuntu.Components.Popups 1.3
2279 import QtQuick.Layouts 1.1
2280
2281 Dialog {
2282
2283=== modified file 'src/app/qml/textView/TextView.qml'
2284--- src/app/qml/textView/TextView.qml 2015-10-10 12:03:30 +0000
2285+++ src/app/qml/textView/TextView.qml 2015-11-27 16:47:37 +0000
2286@@ -15,14 +15,14 @@
2287 */
2288
2289 import QtQuick 2.4
2290-import Ubuntu.Components 1.2
2291-import Ubuntu.Components.Themes.Ambiance 1.2
2292+import Ubuntu.Components 1.3
2293+import Ubuntu.Components.Themes.Ambiance 1.3
2294
2295 import "../common/utils.js" as Utils
2296
2297 Page {
2298 id: textPage
2299- title: Utils.getNameOfFile(file.path);
2300+ title: Utils.getNameOfFile(file.path)
2301
2302 // Reset night mode shader settings when closing the page
2303 // Component.onDestruction: mainView.nightModeEnabled = false
2304
2305=== modified file 'src/app/qml/textView/TextViewDefaultHeader.qml'
2306--- src/app/qml/textView/TextViewDefaultHeader.qml 2015-10-10 12:03:30 +0000
2307+++ src/app/qml/textView/TextViewDefaultHeader.qml 2015-11-27 16:47:37 +0000
2308@@ -15,9 +15,10 @@
2309 */
2310
2311 import QtQuick 2.4
2312-import Ubuntu.Components 1.2
2313+import Ubuntu.Components 1.3
2314 import QtQuick.Layouts 1.1
2315-import Ubuntu.Components.Popups 1.0
2316+import Ubuntu.Components.Popups 1.3
2317+import DocumentViewer 1.0
2318
2319 PageHeadState {
2320 id: rootItem
2321@@ -31,7 +32,7 @@
2322 anchors.fill: parent
2323 spacing: units.gu(1)
2324
2325- ActivityIndicator { id: activity }
2326+ ActivityIndicator { id: activity; visible: running }
2327
2328 Column {
2329 id: layout
2330@@ -50,27 +51,12 @@
2331 //horizontalAlignment: Text.AlignHCenter
2332 elide: Text.ElideMiddle
2333
2334- fontSize: "small"
2335+ textSize: Label.Small
2336 text: file.mimetype.description
2337 }
2338 }
2339 }
2340
2341- backAction: Action {
2342- iconName: "back"
2343- text: (pageStack.depth > 1) ? i18n.tr("Back") : i18n.tr("Close")
2344- onTriggered: {
2345- if (pageStack.depth > 1) {
2346- // Go back to Welcome page
2347- pageStack.pop();
2348- } else {
2349- // File has been imported through Content Hub (or was not chosen through WelcomePage)
2350- // Close the application and show our source app (e.g. ubuntu-filemanager-app, if used to open a document)
2351- Qt.quit()
2352- }
2353- }
2354- }
2355-
2356 actions: [
2357 Action {
2358 iconName: "night-mode"
2359
2360=== modified file 'src/app/qml/ubuntu-docviewer-app.qml'
2361--- src/app/qml/ubuntu-docviewer-app.qml 2015-11-11 19:59:15 +0000
2362+++ src/app/qml/ubuntu-docviewer-app.qml 2015-11-27 16:47:37 +0000
2363@@ -15,8 +15,8 @@
2364 */
2365
2366 import QtQuick 2.4
2367-import Ubuntu.Components 1.2
2368-import Ubuntu.Components.Popups 1.0
2369+import Ubuntu.Components 1.3
2370+import Ubuntu.Components.Popups 1.3
2371 import DocumentViewer 1.0
2372 import QtQuick.Window 2.0
2373 import Qt.labs.settings 1.0
2374@@ -66,36 +66,24 @@
2375 mainView, { parent: mainView });
2376 }
2377
2378- function toggleFullScreen() {
2379- mainView.fullscreen = !mainView.fullscreen
2380- }
2381-
2382- function setHeaderVisibility(visible, toggleFullscreen) {
2383- toggleFullscreen = typeof toggleFullscreen !== 'undefined' ? toggleFullscreen : true
2384- header.visible = visible;
2385-
2386+ function switchToBrowseMode() {
2387+ mainView.pickMode = false
2388+ }
2389+
2390+ function switchToPickMode() {
2391+ mainView.pickMode = true
2392+ }
2393+
2394+ onIsLandscapeChanged: {
2395 // If device orientation is landscape and screen width is limited,
2396 // force hiding Unity 8 indicators panel.
2397 if (!DocumentViewer.desktopMode && mainView.isLandscape &&
2398 mainView.width < units.gu(51)) {
2399- mainView.fullscreen = true;
2400+ mainView.fullscreen = true
2401 return;
2402+ } else {
2403+ mainView.fullscreen = false
2404 }
2405-
2406- if (!DocumentViewer.desktopMode && toggleFullscreen)
2407- mainView.fullscreen = !visible;
2408- }
2409-
2410- function toggleHeaderVisibility() {
2411- setHeaderVisibility(!header.visible);
2412- }
2413-
2414- function switchToBrowseMode() {
2415- mainView.pickMode = false
2416- }
2417-
2418- function switchToPickMode() {
2419- mainView.pickMode = true
2420 }
2421
2422 function showErrorDialog(message) {
2423@@ -103,9 +91,6 @@
2424 mainView, { parent: mainView, text: message });
2425 }
2426
2427- // On screen rotation, force updating of header/U8 indicators panel visibility
2428- onIsLandscapeChanged: setHeaderVisibility(true);
2429-
2430 onFullscreenChanged: {
2431 if (mainView.fullscreen)
2432 window.visibility = Window.FullScreen
2433
2434=== removed directory 'src/app/qml/upstreamComponents'
2435=== modified file 'src/plugin/libreofficetoolkit-qml-plugin/qml/Viewer.qml'
2436--- src/plugin/libreofficetoolkit-qml-plugin/qml/Viewer.qml 2015-11-11 19:59:15 +0000
2437+++ src/plugin/libreofficetoolkit-qml-plugin/qml/Viewer.qml 2015-11-27 16:47:37 +0000
2438@@ -31,7 +31,21 @@
2439
2440 function adjustZoomToWidth()
2441 {
2442- view.adjustZoomToWidth();
2443+ var oldZoom = view.zoomFactor
2444+ view.adjustZoomToWidth()
2445+
2446+ var zoomScale = view.zoomFactor / oldZoom
2447+ rootFlickable.contentX *= zoomScale
2448+ rootFlickable.contentY *= zoomScale
2449+ }
2450+
2451+ function setZoom(newValue)
2452+ {
2453+ var zoomScale = newValue / view.zoomFactor;
2454+ view.zoomFactor = newValue;
2455+
2456+ rootFlickable.contentX *= zoomScale;
2457+ rootFlickable.contentY *= zoomScale;
2458 }
2459
2460 function moveView(axis, diff)

Subscribers

People subscribed via source and target branches