Merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/loview-fullscreen-presentation-mode into lp:ubuntu-docviewer-app

Proposed by Stefano Verzegnassi
Status: Work in progress
Proposed branch: lp:~verzegnassi-stefano/ubuntu-docviewer-app/loview-fullscreen-presentation-mode
Merge into: lp:ubuntu-docviewer-app
Prerequisite: lp:~verzegnassi-stefano/ubuntu-docviewer-app/lok-qml-async-imageprovider
Diff against target: 194 lines (+138/-4)
3 files modified
po/com.ubuntu.docviewer.pot (+15/-4)
src/app/qml/loView/LOViewDefaultHeader.qml (+8/-0)
src/app/qml/loView/LoPresentation.qml (+115/-0)
To merge this branch: bzr merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/loview-fullscreen-presentation-mode
Reviewer Review Type Date Requested Status
Ubuntu Document Viewer Developers Pending
Review via email: mp+282879@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

245. By Stefano Verzegnassi

Merged parent branch lp:~verzegnassi-stefano/ubuntu-docviewer-app/lok-qml-async-imageprovider

244. By Stefano Verzegnassi

Added a full-screen mode for LO presentation docs

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'po/com.ubuntu.docviewer.pot'
2--- po/com.ubuntu.docviewer.pot 2016-01-17 21:20:01 +0000
3+++ po/com.ubuntu.docviewer.pot 2016-01-17 21:20:01 +0000
4@@ -8,7 +8,7 @@
5 msgstr ""
6 "Project-Id-Version: \n"
7 "Report-Msgid-Bugs-To: \n"
8-"POT-Creation-Date: 2016-01-07 12:16+0100\n"
9+"POT-Creation-Date: 2016-01-17 14:39+0100\n"
10 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13@@ -41,7 +41,7 @@
14 msgstr ""
15
16 #: ../src/app/qml/common/DetailsPage.qml:26
17-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:107
18+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:115
19 #: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:83
20 #: ../src/app/qml/textView/TextViewDefaultHeader.qml:69
21 msgid "Details"
22@@ -341,13 +341,17 @@
23 msgid "Go to position..."
24 msgstr ""
25
26-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
27+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:101
28+msgid "Presentation"
29+msgstr ""
30+
31+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:108
32 #: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
33 #: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
34 msgid "Disable night mode"
35 msgstr ""
36
37-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
38+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:108
39 #: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
40 #: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
41 msgid "Enable night mode"
42@@ -380,6 +384,13 @@
43 "The requested document may be corrupt or protected by a password."
44 msgstr ""
45
46+#. TRANSLATORS: the first argument (%1) refers to the slide currently shown on the screen,
47+#. while the second one (%2) refers to the total slides count.
48+#: ../src/app/qml/loView/LoPresentation.qml:50
49+#, qt-format
50+msgid "Slide %1 of %2"
51+msgstr ""
52+
53 #. TRANSLATORS: 'LibreOfficeKit' is the name of the library used by
54 #. Document Viewer for rendering LibreOffice/MS-Office documents.
55 #. Ref. https://docs.libreoffice.org/libreofficekit.html
56
57=== modified file 'src/app/qml/loView/LOViewDefaultHeader.qml'
58--- src/app/qml/loView/LOViewDefaultHeader.qml 2015-11-30 12:12:10 +0000
59+++ src/app/qml/loView/LOViewDefaultHeader.qml 2016-01-17 21:20:01 +0000
60@@ -96,6 +96,14 @@
61 },
62
63 Action {
64+ objectName:"presentationmode"
65+ iconName: "slideshow"
66+ text: i18n.tr("Presentation")
67+ visible: targetPage.contentItem.loDocument.documentType == LibreOffice.Document.PresentationDocument
68+ onTriggered: pageStack.push(Qt.resolvedUrl("./LoPresentation.qml"), {'view': targetPage.contentItem.loView})
69+ },
70+
71+ Action {
72 iconName: "night-mode"
73 text: mainView.nightModeEnabled ? i18n.tr("Disable night mode") : i18n.tr("Enable night mode")
74
75
76=== added file 'src/app/qml/loView/LoPresentation.qml'
77--- src/app/qml/loView/LoPresentation.qml 1970-01-01 00:00:00 +0000
78+++ src/app/qml/loView/LoPresentation.qml 2016-01-17 21:20:01 +0000
79@@ -0,0 +1,115 @@
80+/*
81+ * Copyright (C) 2013-2016 Canonical, Ltd.
82+ *
83+ * This program is free software; you can redistribute it and/or modify
84+ * it under the terms of the GNU General Public License as published by
85+ * the Free Software Foundation; version 3.
86+ *
87+ * This program is distributed in the hope that it will be useful,
88+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
89+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
90+ * GNU General Public License for more details.
91+ *
92+ * You should have received a copy of the GNU General Public License
93+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
94+ */
95+
96+import QtQuick 2.4
97+import Ubuntu.Components 1.3
98+import DocumentViewer 1.0
99+
100+Page {
101+ id: loPresentationPage
102+ property var view
103+
104+ anchors.fill: parent
105+ title: DocumentViewer.getFileBaseNameFromPath(view.documentPath)
106+ focus: true
107+
108+ header: PageHeader {
109+ visible: false
110+ leadingActionBar.actions: [
111+ Action {
112+ iconName: "back"
113+ text: "Back"
114+ onTriggered: pageStack.pop()
115+ }
116+ ]
117+ contents: ListItemLayout {
118+ anchors.centerIn: parent
119+ title {
120+ font.weight: Font.DemiBold
121+ textSize: Label.Large
122+ text: loPresentationPage.title
123+ color: loPresentationPage.header.__styleInstance.foregroundColor
124+ }
125+ subtitle {
126+ textSize: Label.Medium
127+ // TRANSLATORS: the first argument (%1) refers to the slide currently shown on the screen,
128+ // while the second one (%2) refers to the total slides count.
129+ text: i18n.tr("Slide %1 of %2").arg(loPresentationView.currentIndex + 1).arg(loPresentationView.count)
130+ color: loPresentationPage.header.__styleInstance.foregroundColor
131+ }
132+ }
133+
134+ StyleHints {
135+ backgroundColor: "#BF000000"
136+ foregroundColor: "white"
137+ }
138+ }
139+
140+ Rectangle {
141+ anchors.fill: parent
142+ color: "black"
143+ }
144+
145+ ListView {
146+ id: loPresentationView
147+ anchors.fill: parent
148+ focus: true
149+
150+ currentIndex: view.currentPart
151+ orientation: Qt.Horizontal;
152+ snapMode: ListView.SnapOneItem
153+ highlightRangeMode: ListView.StrictlyEnforceRange
154+ highlightFollowsCurrentItem: true
155+ highlightMoveDuration: 0
156+ boundsBehavior: Flickable.StopAtBounds
157+ cacheBuffer: width
158+
159+ model: view.partsModel
160+ delegate: Image {
161+ height: loPresentationPage.height; width: loPresentationPage.width
162+ fillMode: Image.PreserveAspectFit
163+ cache: false
164+ source: "image://lok/part/%1".arg(model.index)
165+ sourceSize {
166+ width: loPresentationPage.height
167+ height: loPresentationPage.width
168+ }
169+ }
170+
171+ Component.onCompleted: loPresentationPage.forceActiveFocus()
172+
173+ MouseArea {
174+ anchors.fill: parent
175+ onDoubleClicked: loPresentationPage.header.visible = !loPresentationPage.header.visible
176+ }
177+ }
178+
179+ Keys.onPressed: {
180+ if (event.key == Qt.Key_Escape) { pageStack.pop(); return; }
181+ if (event.key == Qt.Key_Home) { loPresentationView.positionViewAtBeginning(); return; }
182+ if (event.key == Qt.Key_End) { loPresentationView.positionViewAtEnd(); return; }
183+
184+ if (event.key == Qt.Key_Right || event.key == Qt.Key_PageDown) {
185+ loPresentationView.incrementCurrentIndex();
186+ return;
187+ }
188+ if (event.key == Qt.Key_Left || event.key == Qt.Key_PageUp) {
189+ loPresentationView.decrementCurrentIndex();
190+ return;
191+ }
192+ }
193+}
194+

Subscribers

People subscribed via source and target branches