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
=== modified file 'po/com.ubuntu.docviewer.pot'
--- po/com.ubuntu.docviewer.pot 2016-01-17 21:20:01 +0000
+++ po/com.ubuntu.docviewer.pot 2016-01-17 21:20:01 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: \n"9"Project-Id-Version: \n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2016-01-07 12:16+0100\n"11"POT-Creation-Date: 2016-01-17 14:39+0100\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -41,7 +41,7 @@
41msgstr ""41msgstr ""
4242
43#: ../src/app/qml/common/DetailsPage.qml:2643#: ../src/app/qml/common/DetailsPage.qml:26
44#: ../src/app/qml/loView/LOViewDefaultHeader.qml:10744#: ../src/app/qml/loView/LOViewDefaultHeader.qml:115
45#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:8345#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:83
46#: ../src/app/qml/textView/TextViewDefaultHeader.qml:6946#: ../src/app/qml/textView/TextViewDefaultHeader.qml:69
47msgid "Details"47msgid "Details"
@@ -341,13 +341,17 @@
341msgid "Go to position..."341msgid "Go to position..."
342msgstr ""342msgstr ""
343343
344#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100344#: ../src/app/qml/loView/LOViewDefaultHeader.qml:101
345msgid "Presentation"
346msgstr ""
347
348#: ../src/app/qml/loView/LOViewDefaultHeader.qml:108
345#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77349#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
346#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63350#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
347msgid "Disable night mode"351msgid "Disable night mode"
348msgstr ""352msgstr ""
349353
350#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100354#: ../src/app/qml/loView/LOViewDefaultHeader.qml:108
351#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77355#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
352#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63356#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
353msgid "Enable night mode"357msgid "Enable night mode"
@@ -380,6 +384,13 @@
380"The requested document may be corrupt or protected by a password."384"The requested document may be corrupt or protected by a password."
381msgstr ""385msgstr ""
382386
387#. TRANSLATORS: the first argument (%1) refers to the slide currently shown on the screen,
388#. while the second one (%2) refers to the total slides count.
389#: ../src/app/qml/loView/LoPresentation.qml:50
390#, qt-format
391msgid "Slide %1 of %2"
392msgstr ""
393
383#. TRANSLATORS: 'LibreOfficeKit' is the name of the library used by394#. TRANSLATORS: 'LibreOfficeKit' is the name of the library used by
384#. Document Viewer for rendering LibreOffice/MS-Office documents.395#. Document Viewer for rendering LibreOffice/MS-Office documents.
385#. Ref. https://docs.libreoffice.org/libreofficekit.html396#. Ref. https://docs.libreoffice.org/libreofficekit.html
386397
=== modified file 'src/app/qml/loView/LOViewDefaultHeader.qml'
--- src/app/qml/loView/LOViewDefaultHeader.qml 2015-11-30 12:12:10 +0000
+++ src/app/qml/loView/LOViewDefaultHeader.qml 2016-01-17 21:20:01 +0000
@@ -96,6 +96,14 @@
96 },96 },
9797
98 Action {98 Action {
99 objectName:"presentationmode"
100 iconName: "slideshow"
101 text: i18n.tr("Presentation")
102 visible: targetPage.contentItem.loDocument.documentType == LibreOffice.Document.PresentationDocument
103 onTriggered: pageStack.push(Qt.resolvedUrl("./LoPresentation.qml"), {'view': targetPage.contentItem.loView})
104 },
105
106 Action {
99 iconName: "night-mode"107 iconName: "night-mode"
100 text: mainView.nightModeEnabled ? i18n.tr("Disable night mode") : i18n.tr("Enable night mode")108 text: mainView.nightModeEnabled ? i18n.tr("Disable night mode") : i18n.tr("Enable night mode")
101109
102110
=== added file 'src/app/qml/loView/LoPresentation.qml'
--- src/app/qml/loView/LoPresentation.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/loView/LoPresentation.qml 2016-01-17 21:20:01 +0000
@@ -0,0 +1,115 @@
1/*
2 * Copyright (C) 2013-2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import DocumentViewer 1.0
20
21Page {
22 id: loPresentationPage
23 property var view
24
25 anchors.fill: parent
26 title: DocumentViewer.getFileBaseNameFromPath(view.documentPath)
27 focus: true
28
29 header: PageHeader {
30 visible: false
31 leadingActionBar.actions: [
32 Action {
33 iconName: "back"
34 text: "Back"
35 onTriggered: pageStack.pop()
36 }
37 ]
38 contents: ListItemLayout {
39 anchors.centerIn: parent
40 title {
41 font.weight: Font.DemiBold
42 textSize: Label.Large
43 text: loPresentationPage.title
44 color: loPresentationPage.header.__styleInstance.foregroundColor
45 }
46 subtitle {
47 textSize: Label.Medium
48 // TRANSLATORS: the first argument (%1) refers to the slide currently shown on the screen,
49 // while the second one (%2) refers to the total slides count.
50 text: i18n.tr("Slide %1 of %2").arg(loPresentationView.currentIndex + 1).arg(loPresentationView.count)
51 color: loPresentationPage.header.__styleInstance.foregroundColor
52 }
53 }
54
55 StyleHints {
56 backgroundColor: "#BF000000"
57 foregroundColor: "white"
58 }
59 }
60
61 Rectangle {
62 anchors.fill: parent
63 color: "black"
64 }
65
66 ListView {
67 id: loPresentationView
68 anchors.fill: parent
69 focus: true
70
71 currentIndex: view.currentPart
72 orientation: Qt.Horizontal;
73 snapMode: ListView.SnapOneItem
74 highlightRangeMode: ListView.StrictlyEnforceRange
75 highlightFollowsCurrentItem: true
76 highlightMoveDuration: 0
77 boundsBehavior: Flickable.StopAtBounds
78 cacheBuffer: width
79
80 model: view.partsModel
81 delegate: Image {
82 height: loPresentationPage.height; width: loPresentationPage.width
83 fillMode: Image.PreserveAspectFit
84 cache: false
85 source: "image://lok/part/%1".arg(model.index)
86 sourceSize {
87 width: loPresentationPage.height
88 height: loPresentationPage.width
89 }
90 }
91
92 Component.onCompleted: loPresentationPage.forceActiveFocus()
93
94 MouseArea {
95 anchors.fill: parent
96 onDoubleClicked: loPresentationPage.header.visible = !loPresentationPage.header.visible
97 }
98 }
99
100 Keys.onPressed: {
101 if (event.key == Qt.Key_Escape) { pageStack.pop(); return; }
102 if (event.key == Qt.Key_Home) { loPresentationView.positionViewAtBeginning(); return; }
103 if (event.key == Qt.Key_End) { loPresentationView.positionViewAtEnd(); return; }
104
105 if (event.key == Qt.Key_Right || event.key == Qt.Key_PageDown) {
106 loPresentationView.incrementCurrentIndex();
107 return;
108 }
109 if (event.key == Qt.Key_Left || event.key == Qt.Key_PageUp) {
110 loPresentationView.decrementCurrentIndex();
111 return;
112 }
113 }
114}
115

Subscribers

People subscribed via source and target branches