← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/pdfview-show-hide-header into lp:ubuntu-docviewer-app

 

Stefano Verzegnassi has proposed merging lp:~verzegnassi-stefano/ubuntu-docviewer-app/pdfview-show-hide-header into lp:ubuntu-docviewer-app.

Commit message:
Show/Hide header on tap in PdfView

Requested reviews:
  Ubuntu Document Viewer Developers (ubuntu-docviewer-dev)
Related bugs:
  Bug #1419468 in Ubuntu Document Viewer App: "[pdfView] show/hide page header on tap"
  https://bugs.launchpad.net/ubuntu-docviewer-app/+bug/1419468

For more details, see:
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/pdfview-show-hide-header/+merge/255076

Show/Hide header on tap in PdfView
-- 
Your team Ubuntu Document Viewer Developers is requested to review the proposed merge of lp:~verzegnassi-stefano/ubuntu-docviewer-app/pdfview-show-hide-header into lp:ubuntu-docviewer-app.
=== modified file 'po/com.ubuntu.docviewer.pot'
--- po/com.ubuntu.docviewer.pot	2015-03-25 16:51:53 +0000
+++ po/com.ubuntu.docviewer.pot	2015-04-02 12:19:24 +0000
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-03-25 17:51+0100\n"
+"POT-Creation-Date: 2015-04-02 13:46+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@xxxxxx>\n"
@@ -189,7 +189,7 @@
 msgstr ""
 
 #: ../src/app/qml/documentPage/DocumentPage.qml:25
-#: /home/stefano/Progetti/doc-viewer/build-ubuntu-docviewer-app-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:1
+#: /home/stefano/Progetti/docviewer/build-ubuntu-docviewer-app-UbuntuSDK_for_armhf_GCC_ubuntu_sdk_15_04_vivid-Default/po/com.ubuntu.docviewer.desktop.in.in.h:1
 msgid "Document Viewer"
 msgstr ""
 
@@ -254,6 +254,6 @@
 msgid "Loading..."
 msgstr ""
 
-#: /home/stefano/Progetti/doc-viewer/build-ubuntu-docviewer-app-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:2
+#: /home/stefano/Progetti/docviewer/build-ubuntu-docviewer-app-UbuntuSDK_for_armhf_GCC_ubuntu_sdk_15_04_vivid-Default/po/com.ubuntu.docviewer.desktop.in.in.h:2
 msgid "documents;viewer;pdf;reader;"
 msgstr ""

=== modified file 'src/app/qml/pdfView/PdfView.qml'
--- src/app/qml/pdfView/PdfView.qml	2015-03-12 19:00:33 +0000
+++ src/app/qml/pdfView/PdfView.qml	2015-04-02 12:19:24 +0000
@@ -77,6 +77,13 @@
                 // but it's not a problem at the moment (our target is phone).
                 DOC_VIEWER.releaseResources();
             }
+
+            MouseArea {
+                objectName: "mouseArea"
+
+                anchors.fill: parent
+                onClicked: pdfPage.header.visible = !pdfPage.header.visible
+            }
         }
 
         Item { id: _zoomHelper }
@@ -96,7 +103,10 @@
 
             var title = getDocumentInfo("Title")
             if (title !== "")
-                pdfPage.title = title
+                pdfPage.title = title;
+
+            // Hide header when the document is ready
+            pdfPage.header.visible = false;
         }
     }
 

=== modified file 'tests/autopilot/ubuntu_docviewer_app/__init__.py'
--- tests/autopilot/ubuntu_docviewer_app/__init__.py	2014-12-14 20:50:23 +0000
+++ tests/autopilot/ubuntu_docviewer_app/__init__.py	2015-04-02 12:19:24 +0000
@@ -86,6 +86,11 @@
     """Autopilot helper for PdfView page."""
 
     @autopilot_logging.log_action(logger.info)
+    def show_header(self):
+        """Show page header by clicking on the pdf canvas"""
+        mouse_area = self.select_single('QQuickMouseArea', objectName='mouseArea')
+        self.pointing_device.click_object(mouse_area)
+
     def click_go_to_page_button(self):
         """Click the go_to_page header button."""
         header = self.main_view.get_header()

=== modified file 'tests/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py'
--- tests/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py	2015-02-23 13:13:49 +0000
+++ tests/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py	2015-04-02 12:19:24 +0000
@@ -59,6 +59,7 @@
 
         self.launch_app()
         pdf = self.app.main_view.open_PdfView()
+        pdf.show_header()
         pdf.click_go_to_page_button()
         self.go_to_page_no(page_no)
 


Follow ups