← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/pdf-presentation-full-screen into lp:ubuntu-docviewer-app

 

Stefano Verzegnassi has proposed merging lp:~verzegnassi-stefano/ubuntu-docviewer-app/pdf-presentation-full-screen into lp:ubuntu-docviewer-app.

Commit message:
[PdfPresentation] Go automatically full-screen

Requested reviews:
  Ubuntu Document Viewer Developers (ubuntu-docviewer-dev)

For more details, see:
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/pdf-presentation-full-screen/+merge/283718

[PdfPresentation] Go automatically full-screen
-- 
Your team Ubuntu Document Viewer Developers is requested to review the proposed merge of lp:~verzegnassi-stefano/ubuntu-docviewer-app/pdf-presentation-full-screen into lp:ubuntu-docviewer-app.
=== modified file 'src/app/qml/ubuntu-docviewer-app.qml'
--- src/app/qml/ubuntu-docviewer-app.qml	2016-01-14 13:07:09 +0000
+++ src/app/qml/ubuntu-docviewer-app.qml	2016-01-23 13:06:44 +0000
@@ -29,10 +29,18 @@
     objectName: "mainView"
 
     property bool pickMode: commandLineProxy.pickMode
-    property bool fullscreen: commandLineProxy.fullscreen
-
-    readonly property bool wideWindow: width > units.gu(80)
-    readonly property bool veryWideWindow: width > units.gu(120)
+
+    // If device orientation is landscape and screen width is limited,
+    // force hiding Unity 8 indicators panel.
+    property bool fullscreen: commandLineProxy.fullscreen ||
+                              (!desktopMode && isLandscape && narrowWindow) ||
+                              pageStack.currentPage.hasOwnProperty("isPresentation")
+
+    readonly property bool desktopMode: DocumentViewer.desktopMode
+
+    readonly property bool narrowWindow: width < units.gu(51)
+    readonly property bool wideWindow: width >= units.gu(80) && width < units.gu(120)
+    readonly property bool veryWideWindow: width >= units.gu(120)
     readonly property bool isLandscape: Screen.orientation == Qt.LandscapeOrientation ||
                                         Screen.orientation == Qt.InvertedLandscapeOrientation
 
@@ -77,18 +85,6 @@
         mainView.pickMode = true
     }
 
-    onIsLandscapeChanged: {
-        // If device orientation is landscape and screen width is limited,
-        // force hiding Unity 8 indicators panel.
-        if (!DocumentViewer.desktopMode && mainView.isLandscape &&
-                mainView.width < units.gu(51)) {
-            mainView.fullscreen = true
-            return;
-        } else {
-            mainView.fullscreen = false
-        }
-    }
-
     function showErrorDialog(message) {
         PopupUtils.open(Qt.resolvedUrl("common/ErrorDialog.qml"),
                         mainView, { parent: mainView, text: message });


Follow ups