Merge lp:~ahayzen/ubuntu-printing-app/additional-fixes into lp:ubuntu-printing-app

Proposed by Andrew Hayzen
Status: Merged
Approved by: Michael Sheldon
Approved revision: 86
Merged at revision: 25
Proposed branch: lp:~ahayzen/ubuntu-printing-app/additional-fixes
Merge into: lp:ubuntu-printing-app
Prerequisite: lp:~ahayzen/ubuntu-printing-app/add-ubuntu-printing-app
Diff against target: 752 lines (+263/-114)
20 files modified
CMakeLists.txt (+1/-6)
backend/CMakeLists.txt (+2/-2)
debian/control (+0/-2)
setup/gui/ubuntu-printing-app.desktop (+1/-0)
snapcraft.yaml (+1/-3)
tests/qmltests/tst_PreviewRow.qml (+73/-11)
tests/qmltests/tst_PrintPage.qml (+2/-1)
tests/qmltests/tst_SelectorRow.qml (+3/-1)
ubuntu-printing-app/Main.qml (+1/-1)
ubuntu-printing-app/components/BaseRowLayout.qml (+28/-0)
ubuntu-printing-app/components/CMakeLists.txt (+1/-0)
ubuntu-printing-app/components/CheckBoxRow.qml (+2/-10)
ubuntu-printing-app/components/LabelRow.qml (+2/-10)
ubuntu-printing-app/components/PreviewRow.qml (+80/-5)
ubuntu-printing-app/components/PrintRow.qml (+5/-2)
ubuntu-printing-app/components/SelectorRow.qml (+3/-10)
ubuntu-printing-app/components/TextFieldRow.qml (+2/-10)
ubuntu-printing-app/pages/PrintPage.qml (+52/-40)
ubuntu-printing-app/ubuntu-printing-app-content-hub.json (+3/-0)
ubuntu-printing-app/ubuntu-printing-app.desktop.in.in (+1/-0)
To merge this branch: bzr merge lp:~ahayzen/ubuntu-printing-app/additional-fixes
Reviewer Review Type Date Requested Status
Ken VanDine packaging Approve
Michael Sheldon (community) Approve
Review via email: mp+319211@code.launchpad.net

Commit message

* Set max width of options
* Set NoDisplay=true to hide the app in unity
* Hide left/right buttons when they are disabled
* Change the default height of the preview to 40%
* Set a minimum height of 15GU for the preview
* Allow use of a separator to resize the preview height and workaround ScrollView limitations
* Move collate and reverse to the bottom
* Set the content-hub json as this to be a share of content-hub
* Add tests for new separate resize and minimum height

Description of the change

* Set max width of options
* Set NoDisplay=true to hide the app in unity
* Hide left/right buttons when they are disabled
* Change the default height of the preview to 40%
* Set a minimum height of 15GU for the preview
* Allow use of a separator to resize the preview height and workaround ScrollView limitations
* Move collate and reverse to the bottom
* Set the content-hub json as this to be a share of content-hub
* Add tests for new separate resize and minimum height

To post a comment you must log in.
86. By Andrew Hayzen

* Change the default preview height to be 40% of the height
* Set a minimum height of 15GU for the preview
* Update tests

Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Looks good :)

review: Approve
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Packaging changes in rev 85 look fine

review: Approve (packaging)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2017-03-08 13:00:13 +0000
3+++ CMakeLists.txt 2017-03-08 13:00:14 +0000
4@@ -37,12 +37,7 @@
5
6 # Set the path for the QML files and the backend
7 set(UBUNTU_PRINTING_APP_DATA_DIR "${CMAKE_INSTALL_DATADIR}/${APP_HARDCODE}")
8-execute_process(
9-COMMAND qmake -qt=qt5 -query QT_INSTALL_QML
10- OUTPUT_VARIABLE QT_IMPORTS_DIR
11- OUTPUT_STRIP_TRAILING_WHITESPACE
12-)
13-set(MODULE_PATH ${QT_IMPORTS_DIR}/UbuntuPrintingApp)
14+set(MODULE_PATH ${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}/${APP_HARDCODE})
15
16 # Set the exec path
17 if(SNAP_MODE)
18
19=== modified file 'backend/CMakeLists.txt'
20--- backend/CMakeLists.txt 2017-03-08 13:00:13 +0000
21+++ backend/CMakeLists.txt 2017-03-08 13:00:14 +0000
22@@ -30,5 +30,5 @@
23 DEPENDS ${QMLFILES})
24
25 # Install the plugin file
26-install(TARGETS ${LIBNAME} DESTINATION ${MODULE_PATH})
27-install(FILES UbuntuPrintingApp/qmldir DESTINATION ${MODULE_PATH})
28+install(TARGETS ${LIBNAME} DESTINATION ${MODULE_PATH}/UbuntuPrintingApp)
29+install(FILES UbuntuPrintingApp/qmldir DESTINATION ${MODULE_PATH}/UbuntuPrintingApp)
30
31=== modified file 'debian/control'
32--- debian/control 2017-03-08 13:00:13 +0000
33+++ debian/control 2017-03-08 13:00:14 +0000
34@@ -15,10 +15,8 @@
35 qtdeclarative5-ubuntu-content1,
36 qtdeclarative5-ubuntu-ui-extras0.2,
37 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3),
38- qt5-qmake,
39 qtdeclarative5-dev,
40 qtdeclarative5-dev-tools,
41- ubuntu-sdk-qmake-extras,
42 xvfb
43 Standards-Version: 3.9.7
44 Homepage: http://launchpad.net/ubuntu-printing-app
45
46=== modified file 'setup/gui/ubuntu-printing-app.desktop'
47--- setup/gui/ubuntu-printing-app.desktop 2017-03-08 13:00:13 +0000
48+++ setup/gui/ubuntu-printing-app.desktop 2017-03-08 13:00:14 +0000
49@@ -2,6 +2,7 @@
50 Name=ubuntu-printing-app
51 Exec=ubuntu-printing-app
52 Icon=${SNAP}/meta/gui/ubuntu-printing-app.svg
53+NoDisplay=true
54 Terminal=false
55 Type=Application
56 X-Ubuntu-Touch=true
57
58=== modified file 'snapcraft.yaml'
59--- snapcraft.yaml 2017-03-08 13:00:13 +0000
60+++ snapcraft.yaml 2017-03-08 13:00:14 +0000
61@@ -32,10 +32,8 @@
62 - libpoppler-qt5-dev
63 - qml-module-qttest
64 - qml-module-ubuntu-test
65- - qt5-default
66- - qt5-qmake
67 - qtdeclarative5-dev
68- - ubuntu-sdk-qmake-extras
69+ - qtdeclarative5-dev-tools
70 - xvfb
71 configflags: [-DCMAKE_INSTALL_PREFIX=/usr, -DSNAP_MODE=on]
72 plugin: cmake
73
74=== modified file 'tests/qmltests/tst_PreviewRow.qml'
75--- tests/qmltests/tst_PreviewRow.qml 2017-03-08 13:00:13 +0000
76+++ tests/qmltests/tst_PreviewRow.qml 2017-03-08 13:00:14 +0000
77@@ -50,10 +50,20 @@
78 PreviewRow {
79 id: previewRow
80 document: testDocument
81+ monitorMouseArea: globalMouseArea
82 printerJob: mockPrinterJob
83 view: mockView
84 }
85
86+ MouseArea {
87+ id: globalMouseArea
88+ anchors {
89+ fill: parent
90+ }
91+ acceptedButtons: Qt.NoButton
92+ hoverEnabled: true
93+ }
94+
95 SignalSpy {
96 id: documentCountSpy
97 signalName: "onCountChanged"
98@@ -75,6 +85,11 @@
99
100 mockPrinterJob.colorModelType = PrinterEnum.ColorType;
101
102+ mockView.width = units.gu(100);
103+
104+ // Reset the separator y position
105+ findChild(root, "separator").resizer.y = 0;
106+
107 activityIndicatorSpy.target = null;
108 activityIndicatorSpy.clear();
109 documentCountSpy.clear();
110@@ -192,6 +207,7 @@
111 // Check with multi page doc, next button becomes enabled
112 compare(testDocument.count, 3);
113 compare(next.enabled, true);
114+ compare(next.visible, true);
115 compare(pageHelper.page, 0);
116
117 // Check the requested image page is 0
118@@ -202,6 +218,7 @@
119 mouseClick(next);
120 tryCompare(pageHelper, "page", 1);
121 compare(next.enabled, true);
122+ compare(next.visible, true);
123
124 // Check the requested image page is 1
125 // image://poppler/1/true/file:///path/to/file.pdf
126@@ -217,6 +234,7 @@
127 tryCompare(image, "status", Image.Ready);
128 tryCompare(pageHelper, "page", 2);
129 compare(next.enabled, false);
130+ compare(next.visible, false);
131
132 // Check the requested image page is 2
133 // image://poppler/2/true/file:///path/to/file.pdf
134@@ -236,6 +254,7 @@
135 // Check with mulit page doc, previous is still disabled when on 1st
136 compare(testDocument.count, 3);
137 compare(previous.enabled, false);
138+ compare(previous.visible, false);
139 compare(pageHelper.page, 0)
140
141 // Check the requested image page is 0
142@@ -246,6 +265,7 @@
143 pageHelper.page = 2;
144 tryCompare(pageHelper, "page", 2);
145 compare(previous.enabled, true);
146+ compare(previous.visible, true);
147
148 // Check the requested image page is 2
149 // image://poppler/2/true/file:///path/to/file.pdf
150@@ -255,6 +275,7 @@
151 mouseClick(previous);
152 tryCompare(pageHelper, "page", 1);
153 compare(previous.enabled, true);
154+ compare(previous.visible, true);
155
156 // Check the requested image page is 1
157 // image://poppler/1/true/file:///path/to/file.pdf
158@@ -264,6 +285,7 @@
159 mouseClick(previous);
160 tryCompare(pageHelper, "page", 0);
161 compare(previous.enabled, false);
162+ compare(previous.visible, false);
163
164 // Check the requested image page is 0
165 // image://poppler/0/true/file:///path/to/file.pdf
166@@ -296,21 +318,61 @@
167 // test that the implicitHeight is set from the view height
168 var pageHelper = previewRow.pageHelper;
169
170- // min((WIDTH - 10) / ASPECT, HEIGHT / 1.5)
171+ // min((WIDTH - 10) / ASPECT, HEIGHT * 0.4)
172
173 // height/width of 100GU, aspect is 0.71
174- // min((100 - 10) / 0.71, 100 / 1.5)
175- // min(126.76, 66.66)
176- fuzzyCompare(previewRow.implicitHeight, units.gu(66.66), units.gu(1));
177+ // min((100 - 10) / 0.71, 100 * 0.4)
178+ // min(126.76, 40.00)
179+ fuzzyCompare(previewRow.implicitHeight, units.gu(40), units.gu(1));
180
181 // Change the view to have a short width
182- mockView.width = units.gu(50);
183- waitForRendering(previewRow);
184-
185- // width 50GU, height 100GU, aspect is 0.71
186- // min((50 - 10) / 0.71, 100 / 1.5)
187- // min(56.33, 66.66)
188- fuzzyCompare(previewRow.implicitHeight, units.gu(56.33), units.gu(1));
189+ mockView.width = units.gu(20);
190+ waitForRendering(previewRow);
191+
192+ // width 20GU, height 100GU, aspect is 0.71
193+ // min((20 - 10) / 0.71, 100 * 0.4)
194+ // min(14.08, 40.00)
195+ fuzzyCompare(previewRow.implicitHeight, units.gu(14.08), units.gu(1));
196+ }
197+
198+ function test_view_heightDiff() {
199+ // Test that changing the heightDiff changes the view height
200+ var pageHelper = previewRow.pageHelper;
201+
202+ // min((WIDTH - 10) / ASPECT, HEIGHT * 0.4) + heightDiff
203+
204+ // height/width of 100GU, aspect is 0.71
205+ // min((100 - 10) / 0.71, 100 * 0.4)
206+ // min(126.76, 40.00)
207+ fuzzyCompare(previewRow.implicitHeight, units.gu(40), units.gu(1));
208+
209+ var sepearator = findChild(root, "separator");
210+ sepearator.resizer.y = units.gu(10);
211+
212+ waitForRendering(previewRow);
213+
214+ // min(126.76, 40.00) + units.gu(10)
215+ fuzzyCompare(previewRow.implicitHeight, units.gu(50), units.gu(1));
216+ }
217+
218+ function test_view_heightDiff_minimum() {
219+ // Test that changing the heightDiff cannot go below the minimum
220+ var pageHelper = previewRow.pageHelper;
221+
222+ // min((WIDTH - 10) / ASPECT, HEIGHT * 0.4) + heightDiff
223+
224+ // height/width of 100GU, aspect is 0.71
225+ // min((100 - 10) / 0.71, 100 * 0.4)
226+ // min(126.76, 40.00)
227+ fuzzyCompare(previewRow.implicitHeight, units.gu(40), units.gu(1));
228+
229+ var sepearator = findChild(root, "separator");
230+ sepearator.resizer.y = -units.gu(1000);
231+
232+ waitForRendering(previewRow);
233+
234+ // min(126.76, 40.00) - units.gu(1000)
235+ fuzzyCompare(previewRow.implicitHeight, previewRow.minimumHeight, units.gu(1));
236 }
237 }
238 }
239
240=== modified file 'tests/qmltests/tst_PrintPage.qml'
241--- tests/qmltests/tst_PrintPage.qml 2017-03-08 13:00:13 +0000
242+++ tests/qmltests/tst_PrintPage.qml 2017-03-08 13:00:14 +0000
243@@ -27,7 +27,8 @@
244
245 Item {
246 width: units.gu(100)
247- height: units.gu(75)
248+ // use a large height so all options are visible to click
249+ height: units.gu(150)
250
251 // Mock the PrintingHelper
252 QtObject {
253
254=== modified file 'tests/qmltests/tst_SelectorRow.qml'
255--- tests/qmltests/tst_SelectorRow.qml 2017-03-08 13:00:13 +0000
256+++ tests/qmltests/tst_SelectorRow.qml 2017-03-08 13:00:14 +0000
257@@ -71,11 +71,13 @@
258 }
259
260 function test_changeOption() {
261+ var selector = findChild(selectorRow, "selector");
262+
263 // Check selectedIndex is the starting index
264 compare(selectorRow.selectedIndex, dataSelectedIndex);
265
266 // Expand the selector
267- mouseClick(selectorRow);
268+ mouseClick(selector);
269 expansionCompletedSpy.wait();
270 compare(expansionCompletedSpy.count, 1);
271
272
273=== modified file 'ubuntu-printing-app/Main.qml'
274--- ubuntu-printing-app/Main.qml 2017-03-08 13:00:13 +0000
275+++ ubuntu-printing-app/Main.qml 2017-03-08 13:00:14 +0000
276@@ -23,7 +23,7 @@
277 import Ubuntu.Components 1.3
278 import Ubuntu.Components.ListItems 1.3 as ListItems
279 import Ubuntu.Components.Popups 1.3
280-import Ubuntu.Content 1.1
281+import Ubuntu.Content 1.3
282 import UbuntuPrintingApp 1.0
283 import Ubuntu.Components.Extras.Printers 0.1
284
285
286=== added file 'ubuntu-printing-app/components/BaseRowLayout.qml'
287--- ubuntu-printing-app/components/BaseRowLayout.qml 1970-01-01 00:00:00 +0000
288+++ ubuntu-printing-app/components/BaseRowLayout.qml 2017-03-08 13:00:14 +0000
289@@ -0,0 +1,28 @@
290+/*
291+ * Copyright 2017 Canonical Ltd.
292+ *
293+ * This file is part of ubuntu-printing-app.
294+ *
295+ * ubuntu-printing-app is free software; you can redistribute it and/or modify
296+ * it under the terms of the GNU General Public License as published by
297+ * the Free Software Foundation; version 3.
298+ *
299+ * ubuntu-printing-app is distributed in the hope that it will be useful,
300+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
301+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
302+ * GNU General Public License for more details.
303+ *
304+ * You should have received a copy of the GNU General Public License
305+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
306+ *
307+ * Authored-by: Andrew Hayzen <andrew.hayzen@canonical.com>
308+ */
309+import QtQuick 2.4
310+import QtQuick.Layouts 1.1
311+
312+RowLayout {
313+ anchors {
314+ horizontalCenter: parent.horizontalCenter
315+ }
316+ Layout.maximumWidth: Math.min(units.gu(60), parent.width - units.gu(4))
317+}
318
319=== modified file 'ubuntu-printing-app/components/CMakeLists.txt'
320--- ubuntu-printing-app/components/CMakeLists.txt 2017-03-08 13:00:13 +0000
321+++ ubuntu-printing-app/components/CMakeLists.txt 2017-03-08 13:00:14 +0000
322@@ -1,5 +1,6 @@
323 set(COMPONENT_QML_JS_FILES
324 AlertDialog.qml
325+ BaseRowLayout.qml
326 CheckBoxRow.qml
327 LabelRow.qml
328 PreviewRow.qml
329
330=== modified file 'ubuntu-printing-app/components/CheckBoxRow.qml'
331--- ubuntu-printing-app/components/CheckBoxRow.qml 2017-03-08 13:00:13 +0000
332+++ ubuntu-printing-app/components/CheckBoxRow.qml 2017-03-08 13:00:14 +0000
333@@ -1,5 +1,5 @@
334 /*
335- * Copyright 2016 Canonical Ltd.
336+ * Copyright 2016, 2017 Canonical Ltd.
337 *
338 * This file is part of ubuntu-printing-app.
339 *
340@@ -22,15 +22,7 @@
341
342 import Ubuntu.Components 1.3
343
344-RowLayout {
345- anchors {
346- left: parent.left
347- leftMargin: units.gu(2)
348- right: parent.right
349- rightMargin: units.gu(2)
350- }
351- Layout.maximumWidth: width
352-
353+BaseRowLayout {
354 property alias checked: checkbox.checked
355 property alias checkboxText: checkboxLabel.text
356 property alias enabled: checkbox.enabled
357
358=== modified file 'ubuntu-printing-app/components/LabelRow.qml'
359--- ubuntu-printing-app/components/LabelRow.qml 2017-03-08 13:00:13 +0000
360+++ ubuntu-printing-app/components/LabelRow.qml 2017-03-08 13:00:14 +0000
361@@ -1,5 +1,5 @@
362 /*
363- * Copyright 2016 Canonical Ltd.
364+ * Copyright 2016, 2017 Canonical Ltd.
365 *
366 * This file is part of ubuntu-printing-app.
367 *
368@@ -22,15 +22,7 @@
369
370 import Ubuntu.Components 1.3
371
372-RowLayout {
373- anchors {
374- left: parent.left
375- leftMargin: units.gu(2)
376- right: parent.right
377- rightMargin: units.gu(2)
378- }
379- Layout.maximumWidth: width
380-
381+BaseRowLayout {
382 property alias enabled: secondaryLabel.enabled
383 property alias primaryText: primaryLabel.text
384 property alias secondaryText: secondaryLabel.text
385
386=== modified file 'ubuntu-printing-app/components/PreviewRow.qml'
387--- ubuntu-printing-app/components/PreviewRow.qml 2017-03-08 13:00:13 +0000
388+++ ubuntu-printing-app/components/PreviewRow.qml 2017-03-08 13:00:14 +0000
389@@ -1,5 +1,5 @@
390 /*
391- * Copyright 2016 Canonical Ltd.
392+ * Copyright 2016, 2017 Canonical Ltd.
393 *
394 * This file is part of ubuntu-printing-app.
395 *
396@@ -31,12 +31,21 @@
397 }
398 // Use foreground as this element is ontop of the background
399 color: theme.palette.normal.foreground
400- // Height is smallest of
401+
402+ // Height is the calculated height + the difference given by the separator
403+ // but also has a minimumHeight, otherwise it can be resized too small
404+ implicitHeight: Math.max(separator.heightDiff + calcHeight, minimumHeight)
405+
406+ // Calculated height is smallest of
407 // - calc'd height using aspect and width of image
408- // - 2/3 height of the view
409- implicitHeight: Math.min((view.width - units.gu(10)) / pageHelper.aspect, view.height / 1.5)
410+ // - 40% height of the view
411+ readonly property double calcHeight: Math.min((view.width - units.gu(10)) / pageHelper.aspect, view.height * 0.4)
412
413 property Document document
414+ property double minimumHeight: units.gu(15)
415+ // This is the MouseArea that the separator uses to monitor when to change
416+ // the cursorShape
417+ property MouseArea monitorMouseArea: null
418 property var printerJob
419 property var view
420
421@@ -65,6 +74,7 @@
422 objectName: "previousButton"
423 text: "<"
424 width: units.gu(4)
425+ visible: enabled
426
427 onClicked: pageHelper.page--
428 }
429@@ -110,6 +120,7 @@
430 objectName: "nextButton"
431 text: ">"
432 width: units.gu(4)
433+ visible: enabled
434
435 onClicked: pageHelper.page++
436 }
437@@ -117,7 +128,7 @@
438 Rectangle {
439 id: pageOverlay
440 anchors {
441- bottom: parent.bottom
442+ bottom: separator.top
443 left: previewImage.left
444 right: previewImage.right
445 }
446@@ -139,4 +150,68 @@
447 width: parent.width
448 }
449 }
450+
451+ Item {
452+ id: separator
453+ anchors {
454+ bottom: parent.bottom
455+ }
456+ height: units.gu(1)
457+ objectName: "separator"
458+ width: parent.width
459+
460+ readonly property alias heightDiff: resizer.y
461+
462+ // So that qmltests can find the resizer (it has no parent)
463+ readonly property var resizer: resizer
464+
465+ Rectangle {
466+ anchors {
467+ bottom: parent.bottom
468+ left: parent.left
469+ right: parent.right
470+ }
471+ color: theme.palette.normal.base
472+ height: 1
473+ }
474+
475+ Item {
476+ id: resizer
477+ parent: null
478+ }
479+
480+ MouseArea {
481+ id: mouseArea
482+ anchors {
483+ fill: parent
484+ }
485+ cursorShape: Qt.SizeVerCursor
486+ drag {
487+ axis: Drag.YAxis
488+ // Prevent the view being resized smaller than minimumHeight
489+ // otherwise you cannot resize it back
490+ minimumY: -calcHeight + previewRow.minimumHeight
491+ target: resizer
492+ }
493+
494+ // ScrollView has a MouseArea which doesn't propagate hover events
495+ // down to us. So instead we have a global MouseArea that is above
496+ // the ScrollView and passed to us as monitorMouseArea
497+ //
498+ // monitorContainsMouse then tells us if the mouse in the global
499+ // MouseArea is also inside this MouseArea
500+ readonly property bool monitorContainsMouse: {
501+ var relativePos = mapFromItem(monitorMouseArea, monitorMouseArea.mouseX, monitorMouseArea.mouseY);
502+ return contains(Qt.point(relativePos.x, relativePos.y));
503+ }
504+
505+ // When the mouse is inside this MouseArea set the global MouseArea
506+ // cursorShape to be the cursor we want
507+ Binding {
508+ target: monitorMouseArea
509+ property: "cursorShape"
510+ value: mouseArea.monitorContainsMouse ? Qt.SizeVerCursor : Qt.ArrowCursor
511+ }
512+ }
513+ }
514 }
515
516=== modified file 'ubuntu-printing-app/components/PrintRow.qml'
517--- ubuntu-printing-app/components/PrintRow.qml 2017-03-08 13:00:13 +0000
518+++ ubuntu-printing-app/components/PrintRow.qml 2017-03-08 13:00:14 +0000
519@@ -1,5 +1,5 @@
520 /*
521- * Copyright 2016 Canonical Ltd.
522+ * Copyright 2016, 2017 Canonical Ltd.
523 *
524 * This file is part of ubuntu-printing-app.
525 *
526@@ -45,9 +45,12 @@
527 RowLayout {
528 id: rowLayout
529 anchors {
530- fill: parent
531+ bottom: parent.bottom
532+ horizontalCenter: parent.horizontalCenter
533+ top: parent.top
534 }
535 spacing: units.gu(1)
536+ width: Math.min(units.gu(60), parent.width)
537
538 Button {
539 objectName: "cancel"
540
541=== modified file 'ubuntu-printing-app/components/SelectorRow.qml'
542--- ubuntu-printing-app/components/SelectorRow.qml 2017-03-08 13:00:13 +0000
543+++ ubuntu-printing-app/components/SelectorRow.qml 2017-03-08 13:00:14 +0000
544@@ -1,5 +1,5 @@
545 /*
546- * Copyright 2016 Canonical Ltd.
547+ * Copyright 2016, 2017 Canonical Ltd.
548 *
549 * This file is part of ubuntu-printing-app.
550 *
551@@ -23,17 +23,9 @@
552 import Ubuntu.Components 1.3
553 import Ubuntu.Components.ListItems 1.3 as ListItems
554
555-RowLayout {
556+BaseRowLayout {
557 id: rowLayout
558- anchors {
559- left: parent.left
560- leftMargin: units.gu(2)
561- right: parent.right
562- rightMargin: units.gu(2)
563- }
564-
565 implicitHeight: selector.implicitHeight
566- Layout.maximumWidth: width
567
568 property alias delegate: selector.delegate
569 property alias model: selector.model
570@@ -62,6 +54,7 @@
571 }
572 Layout.fillWidth: true
573 Layout.preferredWidth: units.gu(5)
574+ objectName: "selector"
575 selectedIndex: 0
576
577 onExpansionCompleted: rowLayout.expansionCompleted()
578
579=== modified file 'ubuntu-printing-app/components/TextFieldRow.qml'
580--- ubuntu-printing-app/components/TextFieldRow.qml 2017-03-08 13:00:13 +0000
581+++ ubuntu-printing-app/components/TextFieldRow.qml 2017-03-08 13:00:14 +0000
582@@ -1,5 +1,5 @@
583 /*
584- * Copyright 2016 Canonical Ltd.
585+ * Copyright 2016, 2017 Canonical Ltd.
586 *
587 * This file is part of ubuntu-printing-app.
588 *
589@@ -22,15 +22,7 @@
590
591 import Ubuntu.Components 1.3
592
593-RowLayout {
594- anchors {
595- left: parent.left
596- leftMargin: units.gu(2)
597- right: parent.right
598- rightMargin: units.gu(2)
599- }
600- Layout.maximumWidth: width
601-
602+BaseRowLayout {
603 property alias acceptableInput: textField.acceptableInput
604 property alias enabled: textField.enabled
605 property alias inputMethodHints: textField.inputMethodHints
606
607=== modified file 'ubuntu-printing-app/pages/PrintPage.qml'
608--- ubuntu-printing-app/pages/PrintPage.qml 2017-03-08 13:00:13 +0000
609+++ ubuntu-printing-app/pages/PrintPage.qml 2017-03-08 13:00:14 +0000
610@@ -69,6 +69,7 @@
611
612 PreviewRow {
613 document: currentDocument
614+ monitorMouseArea: globalMouseArea
615 Layout.fillHeight: true
616 printerJob: printing.printerJob
617 view: scrollView
618@@ -124,46 +125,6 @@
619 }
620 }
621
622- CheckBoxRow {
623- id: checkboxSelector
624- checkboxText: i18n.tr("Collate")
625- enabled: printing.printerJob.copies > 1 && printing.isLoaded && !printing.pdfMode
626- objectName: "collateCheckBox"
627-
628- onCheckedChanged: {
629- if (printing.printerJob.collate !== checked) {
630- printing.printerJob.collate = checked
631- }
632- }
633-
634- Binding {
635- target: checkboxSelector
636- property: "checked"
637- when: printing.printerJob
638- value: printing.printerJob.collate
639- }
640- }
641-
642- CheckBoxRow {
643- id: reverseSelector
644- checkboxText: i18n.tr("Reverse")
645- enabled: printing.isLoaded && !printing.pdfMode
646- objectName: "reverseCheckBox"
647-
648- onCheckedChanged: {
649- if (printing.printerJob.reverse !== checked) {
650- printing.printerJob.reverse = checked
651- }
652- }
653-
654- Binding {
655- target: reverseSelector
656- property: "checked"
657- when: printing.printerJob
658- value: printing.printerJob.reverse
659- }
660- }
661-
662 SelectorRow {
663 id: pageRangeSelector
664 enabled: printing.isLoaded && !printing.pdfMode
665@@ -280,6 +241,46 @@
666 }
667 }
668
669+ CheckBoxRow {
670+ id: checkboxSelector
671+ checkboxText: i18n.tr("Collate")
672+ enabled: printing.printerJob.copies > 1 && printing.isLoaded && !printing.pdfMode
673+ objectName: "collateCheckBox"
674+
675+ onCheckedChanged: {
676+ if (printing.printerJob.collate !== checked) {
677+ printing.printerJob.collate = checked
678+ }
679+ }
680+
681+ Binding {
682+ target: checkboxSelector
683+ property: "checked"
684+ when: printing.printerJob
685+ value: printing.printerJob.collate
686+ }
687+ }
688+
689+ CheckBoxRow {
690+ id: reverseSelector
691+ checkboxText: i18n.tr("Reverse")
692+ enabled: printing.isLoaded && !printing.pdfMode
693+ objectName: "reverseCheckBox"
694+
695+ onCheckedChanged: {
696+ if (printing.printerJob.reverse !== checked) {
697+ printing.printerJob.reverse = checked
698+ }
699+ }
700+
701+ Binding {
702+ target: reverseSelector
703+ property: "checked"
704+ when: printing.printerJob
705+ value: printing.printerJob.reverse
706+ }
707+ }
708+
709 Item {
710 height: units.gu(2)
711 width: parent.width
712@@ -306,4 +307,15 @@
713 onCancel: page.cancel()
714 onConfirm: page.confirm(document.url)
715 }
716+
717+ // ScrollView has a MouseArea which doesn't propagate hover events
718+ // so this is used to monitor for these events
719+ MouseArea {
720+ id: globalMouseArea
721+ anchors {
722+ fill: parent
723+ }
724+ acceptedButtons: Qt.NoButton
725+ hoverEnabled: true
726+ }
727 }
728
729=== modified file 'ubuntu-printing-app/ubuntu-printing-app-content-hub.json'
730--- ubuntu-printing-app/ubuntu-printing-app-content-hub.json 2016-12-13 23:08:52 +0000
731+++ ubuntu-printing-app/ubuntu-printing-app-content-hub.json 2017-03-08 13:00:14 +0000
732@@ -1,5 +1,8 @@
733 {
734 "destination": [
735 "documents"
736+ ],
737+ "share": [
738+ "documents"
739 ]
740 }
741
742=== modified file 'ubuntu-printing-app/ubuntu-printing-app.desktop.in.in'
743--- ubuntu-printing-app/ubuntu-printing-app.desktop.in.in 2017-03-08 13:00:13 +0000
744+++ ubuntu-printing-app/ubuntu-printing-app.desktop.in.in 2017-03-08 13:00:14 +0000
745@@ -3,6 +3,7 @@
746 Exec=@RUNNER@
747 Icon=@ICON@
748 _Keywords=Print;Printing;
749+NoDisplay=true
750 Terminal=false
751 Type=Application
752 X-Ubuntu-Touch=true

Subscribers

People subscribed via source and target branches

to all changes: