ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #06297
[Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/libreoffice-splashscreen into lp:ubuntu-docviewer-app
Stefano Verzegnassi has proposed merging lp:~verzegnassi-stefano/ubuntu-docviewer-app/libreoffice-splashscreen into lp:ubuntu-docviewer-app.
Commit message:
* Added splashscreen for loViewer
* Moved the async logic that loads loViewer in another component
* Removed 'PanelButton' component - no longer used
* Changed the behaviour of the header in the loViewer: if (textDocument) hideHeader = true
* Don't use a global 'graphics' folder. Assets are now placed in the module which uses them.
Requested reviews:
Ubuntu Document Viewer Developers (ubuntu-docviewer-dev)
Related bugs:
Bug #1495079 in Ubuntu Document Viewer App: "Add credits to the LibreOffice community and a short introduction to docviewer"
https://bugs.launchpad.net/ubuntu-docviewer-app/+bug/1495079
For more details, see:
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/libreoffice-splashscreen/+merge/278957
* Added splashscreen for loViewer
* Moved the async logic that loads loViewer in another component
* Removed 'PanelButton' component - no longer used
* Changed the behaviour of the header in the loViewer: if (textDocument) hideHeader = true
* Don't use a global 'graphics' folder. Assets are now placed in the module which uses them.
P.S. Part of the diff is just trash (i.e. indentation changed).
--
Your team Ubuntu Document Viewer Developers is requested to review the proposed merge of lp:~verzegnassi-stefano/ubuntu-docviewer-app/libreoffice-splashscreen into lp:ubuntu-docviewer-app.
=== modified file 'po/com.ubuntu.docviewer.pot'
--- po/com.ubuntu.docviewer.pot 2015-11-28 22:11:54 +0000
+++ po/com.ubuntu.docviewer.pot 2015-11-30 12:25:27 +0000
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-11-29 01:09+0300\n"
+"POT-Creation-Date: 2015-11-30 13:11+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@xxxxxx>\n"
@@ -42,7 +42,7 @@
msgstr ""
#: ../src/app/qml/common/DetailsPage.qml:25
-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:108
+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:107
#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:83
#: ../src/app/qml/textView/TextViewDefaultHeader.qml:69
msgid "Details"
@@ -114,7 +114,7 @@
#: ../src/app/qml/common/UnknownTypeDialog.qml:38
#: ../src/app/qml/documentPage/DeleteFileDialog.qml:55
#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:28
-#: ../src/app/qml/loView/LOViewGotoDialog.qml:53
+#: ../src/app/qml/loView/LOViewGotoDialog.qml:55
#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:51
msgid "Cancel"
msgstr ""
@@ -334,50 +334,57 @@
msgid "Unknown type document"
msgstr ""
-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:95
+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:85
msgid "Go to position..."
msgstr ""
-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:102
+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
msgid "Disable night mode"
msgstr ""
-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:102
+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
msgid "Enable night mode"
msgstr ""
-#: ../src/app/qml/loView/LOViewGotoDialog.qml:28
+#: ../src/app/qml/loView/LOViewGotoDialog.qml:30
msgid "Go to position"
msgstr ""
-#: ../src/app/qml/loView/LOViewGotoDialog.qml:29
+#: ../src/app/qml/loView/LOViewGotoDialog.qml:31
msgid "Choose a position between 1% and 100%"
msgstr ""
-#: ../src/app/qml/loView/LOViewGotoDialog.qml:60
+#: ../src/app/qml/loView/LOViewGotoDialog.qml:62
#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:58
msgid "GO!"
msgstr ""
-#: ../src/app/qml/loView/LOViewPage.qml:149
+#: ../src/app/qml/loView/LOViewPage.qml:128
msgid "LibreOffice binaries not found."
msgstr ""
-#: ../src/app/qml/loView/LOViewPage.qml:152
+#: ../src/app/qml/loView/LOViewPage.qml:131
msgid "Error while loading LibreOffice."
msgstr ""
-#: ../src/app/qml/loView/LOViewPage.qml:155
+#: ../src/app/qml/loView/LOViewPage.qml:134
msgid ""
"Document not loaded.\n"
"The requested document may be corrupt."
msgstr ""
-#: ../src/app/qml/loView/ZoomSelector.qml:116
+#. TRANSLATORS: 'LibreOfficeKit' is the name of the library used by
+#. Document Viewer for rendering LibreOffice/MS-Office documents.
+#. Ref. https://docs.libreoffice.org/libreofficekit.html
+#: ../src/app/qml/loView/Splashscreen.qml:45
+msgid "Powered by LibreOfficeKit"
+msgstr ""
+
+#: ../src/app/qml/loView/ZoomSelector.qml:110
msgid "Fit width"
msgstr ""
@@ -411,7 +418,7 @@
msgid "Choose a page between 1 and %1"
msgstr ""
-#: ../src/app/qml/ubuntu-docviewer-app.qml:115
+#: ../src/app/qml/ubuntu-docviewer-app.qml:118
msgid "File does not exist."
msgstr ""
@@ -429,10 +436,10 @@
msgid "copy %1"
msgstr ""
-#: /home/qtros/dev/ubuntu-docviewer-app-cpp-optimizations-build/po/com.ubuntu.docviewer.desktop.in.in.h:1
+#: /tmp/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 ""
-#: /home/qtros/dev/ubuntu-docviewer-app-cpp-optimizations-build/po/com.ubuntu.docviewer.desktop.in.in.h:2
+#: /tmp/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/CMakeLists.txt'
--- src/app/CMakeLists.txt 2015-10-21 13:16:12 +0000
+++ src/app/CMakeLists.txt 2015-11-30 12:25:27 +0000
@@ -1,5 +1,4 @@
file(GLOB_RECURSE QML_SRCS *.qml *.js)
-file(GLOB_RECURSE IMAGE_FILES *.qml *.js)
find_package(Qt5Core)
find_package(Qt5Gui)
@@ -37,15 +36,7 @@
)
endif(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
-if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
-add_custom_target(docviewer-imagefiles ALL
- COMMAND cp -r ${CMAKE_CURRENT_SOURCE_DIR}/graphics ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${IMAGE_FILES}
-)
-endif(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
-
install(DIRECTORY qml DESTINATION ${DATA_DIR})
-install(DIRECTORY graphics DESTINATION ${DATA_DIR})
if(CLICK_MODE)
install(TARGETS ubuntu-docviewer-app DESTINATION ${BIN_DIR})
=== removed directory 'src/app/graphics'
=== added file 'src/app/qml/common/ViewerPage.qml'
--- src/app/qml/common/ViewerPage.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/common/ViewerPage.qml 2015-11-30 12:25:27 +0000
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2015 Stefano Verzegnassi <verzegnassi.stefano@xxxxxxxxx>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.4
+import Ubuntu.Components 1.3
+
+// A page that loads its content asynchronously.
+
+Page {
+ id: viewerPage
+
+ property alias splashScreen: splashScreenItem.data
+
+ property alias content: contentLoader.sourceComponent
+ property alias contentItem: contentLoader.item
+
+ property bool loaded: contentLoader.status == Loader.Ready
+ property alias loaderProgress: contentLoader.progress
+ property alias loaderStatus: contentLoader.status
+
+ signal contentLoaded()
+
+ Loader {
+ id: contentLoader
+ anchors.fill: parent
+
+ asynchronous: true
+ sourceComponent: viewerPage.contents
+
+ onLoaded: viewerPage.contentLoaded()
+ }
+
+ Item {
+ id: splashScreenItem
+ anchors.fill: parent
+
+ visible: contentLoader.status != Loader.Ready
+ enabled: visible
+ }
+}
=== modified file 'src/app/qml/loView/KeybHelper.js'
--- src/app/qml/loView/KeybHelper.js 2015-10-19 11:44:11 +0000
+++ src/app/qml/loView/KeybHelper.js 2015-11-30 12:25:27 +0000
@@ -17,7 +17,7 @@
function parseEvent(event) {
var pixelDiff = 5;
- var view = loPageContentLoader.item.loView
+ var view = loPage.contentItem.loView
var isPresentation = view.document.documentType === LibreOffice.Document.PresentationDocument
if (event.key == Qt.Key_PageUp) {
=== modified file 'src/app/qml/loView/LOViewDefaultHeader.qml'
--- src/app/qml/loView/LOViewDefaultHeader.qml 2015-11-13 21:35:22 +0000
+++ src/app/qml/loView/LOViewDefaultHeader.qml 2015-11-30 12:25:27 +0000
@@ -37,32 +37,32 @@
Layout.fillWidth: true
Label {
- anchors { left: parent.left; right: parent.right }
- elide: Text.ElideMiddle
- font.weight: Font.DemiBold
- text: targetPage.title
- }
- Label {
- anchors { left: parent.left; right: parent.right }
- elide: Text.ElideMiddle
- textSize: Label.Small
- text: {
- if (!loPageContentLoader.item)
- return i18n.tr("Loading...")
+ anchors { left: parent.left; right: parent.right }
+ elide: Text.ElideMiddle
+ font.weight: Font.DemiBold
+ text: targetPage.title
+ }
+ Label {
+ anchors { left: parent.left; right: parent.right }
+ elide: Text.ElideMiddle
+ textSize: Label.Small
+ text: {
+ if (!targetPage.contentItem)
+ return i18n.tr("Loading...")
- switch(loPageContentLoader.item.loDocument.documentType) {
- case 0:
- return i18n.tr("LibreOffice text document")
- case 1:
- return i18n.tr("LibreOffice spread sheet")
- case 2:
- return i18n.tr("LibreOffice presentation")
- case 3:
- return i18n.tr("LibreOffice Draw document")
- case 4:
- return i18n.tr("Unknown LibreOffice document")
- default:
- return i18n.tr("Unknown type document")
+ switch(targetPage.contentItem.loDocument.documentType) {
+ case 0:
+ return i18n.tr("LibreOffice text document")
+ case 1:
+ return i18n.tr("LibreOffice spread sheet")
+ case 2:
+ return i18n.tr("LibreOffice presentation")
+ case 3:
+ return i18n.tr("LibreOffice Draw document")
+ case 4:
+ return i18n.tr("Unknown LibreOffice document")
+ default:
+ return i18n.tr("Unknown type document")
}
}
}
@@ -72,34 +72,33 @@
Layout.preferredWidth: units.gu(12)
Layout.preferredHeight: units.gu(4)
- visible: {
- if (!loPageContentLoader.item)
- return false
-
- return DocumentViewer.desktopMode || targetPage.width > units.gu(80)
- }
+ view: targetPage.contentItem.loView
+ visible: targetPage.contentItem && (DocumentViewer.desktopMode || mainView.wideWindow)
}
}
actions: [
- /* Action {
- iconName: "Search"
- text: i18n.tr("Search")
- enabled: false
- },*/
-
Action {
// FIXME: Autopilot test broken... seems not to detect we're now using an ActionBar since the switch to UITK 1.3
objectName: "gotopage"
iconName: "browser-tabs"
text: i18n.tr("Go to position...")
- onTriggered: PopupUtils.open(Qt.resolvedUrl("LOViewGotoDialog.qml"), targetPage)
- visible: loPageContentLoader.item.loDocument.documentType == LibreOffice.Document.TextDocument
+ visible: targetPage.contentItem.loDocument.documentType == LibreOffice.Document.TextDocument
+
+ onTriggered: {
+ PopupUtils.open(
+ Qt.resolvedUrl("LOViewGotoDialog.qml"),
+ targetPage,
+ {
+ view: targetPage.contentItem.loView
+ })
+ }
},
Action {
iconName: "night-mode"
text: mainView.nightModeEnabled ? i18n.tr("Disable night mode") : i18n.tr("Enable night mode")
+
onTriggered: mainView.nightModeEnabled = !mainView.nightModeEnabled
},
@@ -107,6 +106,7 @@
objectName: "detailsAction"
text: i18n.tr("Details")
iconName: "info"
+
onTriggered: pageStack.push(Qt.resolvedUrl("../common/DetailsPage.qml"))
}
]
=== modified file 'src/app/qml/loView/LOViewGotoDialog.qml'
--- src/app/qml/loView/LOViewGotoDialog.qml 2015-10-23 11:19:19 +0000
+++ src/app/qml/loView/LOViewGotoDialog.qml 2015-11-30 12:25:27 +0000
@@ -25,6 +25,8 @@
id: goToPageDialog
objectName: "LOViewGotoDialog"
+ property var view
+
title: i18n.tr("Go to position")
text: i18n.tr("Choose a position between 1% and 100%")
@@ -67,9 +69,9 @@
}
function goToPage() {
- var pos = loView.contentHeight * parseInt(goToPageTextField.text) / 100
+ var pos = view.contentHeight * parseInt(goToPageTextField.text) / 100
- loView.contentY = Math.min(pos, (loView.contentHeight - loView.height))
+ view.contentY = Math.min(pos, (view.contentHeight - view.height))
PopupUtils.close(goToPageDialog)
}
}
=== modified file 'src/app/qml/loView/LOViewPage.qml'
--- src/app/qml/loView/LOViewPage.qml 2015-11-27 16:47:28 +0000
+++ src/app/qml/loView/LOViewPage.qml 2015-11-30 12:25:27 +0000
@@ -24,172 +24,150 @@
import "../common"
import "KeybHelper.js" as KeybHelper
-Page {
+ViewerPage {
id: loPage
- title: Utils.getNameOfFile(file.path)
- flickable: null
-
- readonly property bool wideWindow: width > units.gu(120)
-
- Loader {
- id: loPageContentLoader
-
- asynchronous: true
+
+ property bool isPresentation: loPage.contentItem && (loPage.contentItem.loDocument.documentType === LibreOffice.Document.PresentationDocument)
+ property bool isTextDocument: loPage.contentItem && (loPage.contentItem.loDocument.documentType === LibreOffice.Document.TextDocument)
+
+ title: Utils.getNameOfFile(file.path);
+ flickable: isTextDocument ? loPage.contentItem.loView : null
+
+ splashScreen: Splashscreen { }
+
+ content: FocusScope {
+ id: loPageContent
anchors.fill: parent
- sourceComponent: loPageContentComponent
-
- onLoaded: {
- if (loaded) {
- // FIXME: At the moment don't hide header if the document is a presentation
- var isPresentation = (item.loDocument.documentType === LibreOffice.Document.PresentationDocument)
- loPage.flickable = isPresentation ? null : item.loView
- } else loPage.flickable = null
- }
- }
-
- ActivityIndicator {
- running: loPageContentLoader.status != Loader.Ready
- visible: running
- anchors.centerIn: parent
- }
-
- Component {
- id: loPageContentComponent
-
- FocusScope {
- id: loPageContent
+
+ property alias loDocument: loView.document
+ property alias loView: loView
+
+ Layouts {
+ id: layouts
anchors.fill: parent
- property alias loDocument: loView.document
- property alias loView: loView
-
- Layouts {
- id: layouts
- anchors.fill: parent
-
- layouts: [
- ConditionalLayout {
- when: wideWindow
- name: "wideWindowLayout"
-
- Item {
- anchors.fill: parent
-
- ResizeableSidebar {
- id: leftSidebar
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- visible: loDocument.documentType == LibreOffice.Document.PresentationDocument
-
- width: visible ? units.gu(40) : 0
-
- PartsView {
- id: partsView
- anchors.fill: parent
- model: loView.partsModel
- }
- }
-
- ItemLayout {
- item: "pinchArea"
- anchors {
- left: leftSidebar.right
- right: parent.right
- top: parent.top
- bottom: parent.bottom
- }
- }
- }
- }
- ]
-
- ScalingPinchArea {
- id: pinchArea
- objectName: "pinchArea"
- Layouts.item: "pinchArea"
-
- targetFlickable: loView
- onTotalScaleChanged: targetFlickable.updateContentSize(totalScale)
-
+ layouts: [
+ ConditionalLayout {
+ when: mainView.veryWideWindow
+ name: "wideWindowLayout"
+
+ Item {
+ anchors.fill: parent
+
+ ResizeableSidebar {
+ id: leftSidebar
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ visible: loPage.isPresentation
+
+ width: visible ? units.gu(40) : 0
+
+ PartsView {
+ id: partsView
+ anchors.fill: parent
+ model: loView.partsModel
+ }
+ }
+
+ ItemLayout {
+ item: "pinchArea"
+ anchors {
+ left: leftSidebar.right
+ right: parent.right
+ top: parent.top
+ bottom: parent.bottom
+ }
+ }
+ }
+ }
+ ]
+
+ ScalingPinchArea {
+ id: pinchArea
+ objectName: "pinchArea"
+ Layouts.item: "pinchArea"
+
+ targetFlickable: loView
+ onTotalScaleChanged: targetFlickable.updateContentSize(totalScale)
+
+ anchors {
+ top: parent.top
+ left: parent.left
+ right: parent.right
+ bottom: bottomBar.top
+ }
+
+ LibreOffice.Viewer {
+ id: loView
+ objectName: "loView"
+ anchors.fill: parent
+
+ clip: true
+ documentPath: file.path
+
+ function updateContentSize(tgtScale) {
+ zoomFactor = tgtScale
+ }
+
+ // Keyboard events
+ focus: true
+ Keys.onPressed: KeybHelper.parseEvent(event)
+
+ Component.onCompleted: {
+ // WORKAROUND: Fix for wrong grid unit size
+ flickDeceleration = 1500 * units.gridUnit / 8
+ maximumFlickVelocity = 2500 * units.gridUnit / 8
+ loPageContent.forceActiveFocus()
+ }
+
+ onErrorChanged: {
+ var errorString;
+
+ switch(error) {
+ case LibreOffice.Error.LibreOfficeNotFound:
+ errorString = i18n.tr("LibreOffice binaries not found.")
+ break;
+ case LibreOffice.Error.LibreOfficeNotInitialized:
+ errorString = i18n.tr("Error while loading LibreOffice.")
+ break;
+ case LibreOffice.Error.DocumentNotLoaded:
+ errorString = i18n.tr("Document not loaded.\nThe requested document may be corrupt.")
+ break;
+ }
+
+ if (errorString) {
+ loPage.pageStack.pop()
+
+ // We create the dialog in the MainView, so that it isn't
+ // initialized by 'loPage' and keep on working after the
+ // page is destroyed.
+ mainView.showErrorDialog(errorString);
+ }
+ }
+
+ Scrollbar { flickableItem: loView; parent: loView.parent }
+ Scrollbar { flickableItem: loView; parent: loView.parent; align: Qt.AlignBottom }
+ }
+ }
+
+ PartsView {
+ id: bottomBar
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
+ height: visible ? units.gu(12) : 0
+ visible: loPage.isPresentation
+
+ model: loView.partsModel
+ orientation: ListView.Horizontal
+
+ HorizontalDivider {
anchors {
+ left: parent.left
+ right: parent.right
top: parent.top
- left: parent.left
- right: parent.right
- bottom: bottomBar.top
- }
-
- LibreOffice.Viewer {
- id: loView
- objectName: "loView"
- anchors.fill: parent
-
- clip: true
- documentPath: file.path
-
- function updateContentSize(tgtScale) {
- zoomFactor = tgtScale
- }
-
- // Keyboard events
- focus: true
- Keys.onPressed: KeybHelper.parseEvent(event)
-
- Component.onCompleted: {
- // WORKAROUND: Fix for wrong grid unit size
- flickDeceleration = 1500 * units.gridUnit / 8
- maximumFlickVelocity = 2500 * units.gridUnit / 8
- loPageContent.forceActiveFocus()
- }
-
- onErrorChanged: {
- var errorString;
-
- switch(error) {
- case LibreOffice.Error.LibreOfficeNotFound:
- errorString = i18n.tr("LibreOffice binaries not found.")
- break;
- case LibreOffice.Error.LibreOfficeNotInitialized:
- errorString = i18n.tr("Error while loading LibreOffice.")
- break;
- case LibreOffice.Error.DocumentNotLoaded:
- errorString = i18n.tr("Document not loaded.\nThe requested document may be corrupt.")
- break;
- }
-
- if (errorString) {
- loPage.pageStack.pop()
-
- // We create the dialog in the MainView, so that it isn't
- // initialized by 'loPage' and keep on working after the
- // page is destroyed.
- mainView.showErrorDialog(errorString);
- }
- }
-
- Scrollbar { flickableItem: loView; parent: loView.parent }
- Scrollbar { flickableItem: loView; parent: loView.parent; align: Qt.AlignBottom }
- }
- }
-
- PartsView {
- id: bottomBar
- anchors {
- left: parent.left
- right: parent.right
- bottom: parent.bottom
- }
- height: visible ? units.gu(12) : 0
- visible: loDocument.documentType == LibreOffice.Document.PresentationDocument
-
- model: loView.partsModel
- orientation: ListView.Horizontal
-
- HorizontalDivider {
- anchors {
- left: parent.left
- right: parent.right
- top: parent.top
- }
}
}
}
=== removed file 'src/app/qml/loView/PanelButton.qml'
--- src/app/qml/loView/PanelButton.qml 2015-10-19 13:00:11 +0000
+++ src/app/qml/loView/PanelButton.qml 1970-01-01 00:00:00 +0000
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2015 Canonical, Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-import QtQuick 2.4
-import Ubuntu.Components 1.3
-
-AbstractButton {
- width: units.gu(4); height: parent.height
-
- property alias iconName: icon.name
- property alias iconSource: icon.source
-
- Icon {
- id: icon
- anchors.centerIn: parent
- width: units.gu(2.5); height: width
- }
-}
=== added file 'src/app/qml/loView/Splashscreen.qml'
--- src/app/qml/loView/Splashscreen.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/loView/Splashscreen.qml 2015-11-30 12:25:27 +0000
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2015 Stefano Verzegnassi
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.4
+import Ubuntu.Components 1.3
+
+Column {
+ spacing: units.gu(4)
+ anchors {
+ verticalCenter: parent.verticalCenter
+ left: parent.left; right: parent.right
+ }
+
+ ActivityIndicator {
+ running: visible
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ Image {
+ source: Qt.resolvedUrl("graphics/libreoffice.png")
+ fillMode: Image.PreserveAspectFit
+ horizontalAlignment: Image.AlignHCenter
+
+ height: units.gu(8)
+ anchors { left: parent.left; right: parent.right }
+ }
+
+ Label {
+ // TRANSLATORS: 'LibreOfficeKit' is the name of the library used by
+ // Document Viewer for rendering LibreOffice/MS-Office documents.
+ // Ref. https://docs.libreoffice.org/libreofficekit.html
+ text: i18n.tr("Powered by LibreOfficeKit")
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+}
=== modified file 'src/app/qml/loView/ZoomSelector.qml'
--- src/app/qml/loView/ZoomSelector.qml 2015-11-13 21:35:22 +0000
+++ src/app/qml/loView/ZoomSelector.qml 2015-11-30 12:25:27 +0000
@@ -26,27 +26,27 @@
anchors.verticalCenter: parent.verticalCenter
width: units.gu(12)
- property var view: loPageContentLoader.item.loView
+ property var view
hasClearButton: true
inputMethodHints: Qt.ImhFormattedNumbersOnly
validator: IntValidator { bottom: 50; top: 400 }
onAccepted: {
- view.setZoom(parseInt(text) / 100)
+ textField.view.setZoom(parseInt(text) / 100)
focus = false
}
onHighlightedChanged: {
if (highlighted) {
- text = parseInt(view.zoomFactor * 100)
+ text = parseInt(textField.view.zoomFactor * 100)
} else text = ""
}
Label {
anchors.centerIn: parent
visible: !textField.highlighted
- text: "%1%".arg(parseInt(view.zoomFactor*100))
+ text: "%1%".arg(parseInt(textField.view.zoomFactor*100))
}
popover: TextFieldButtonPopover {
@@ -62,10 +62,7 @@
Layout.fillHeight: true
Layout.fillWidth: true
- onClicked: {
- var view = loPageContentLoader.item.loView
- view.setZoom(view.zoomFactor + 0.1)
- }
+ onClicked: textField.view.setZoom(textField.view.zoomFactor + 0.1)
Icon {
width: units.gu(2); height: width
@@ -84,10 +81,7 @@
Layout.fillHeight: true
Layout.fillWidth: true
- onClicked: {
- var view = loPageContentLoader.item.loView
- view.setZoom(view.zoomFactor - 0.1)
- }
+ onClicked: textField.view.setZoom(textField.view.zoomFactor - 0.1)
Icon {
width: units.gu(2); height: width
@@ -104,7 +98,7 @@
divider.visible: false
onClicked: {
- view.adjustZoomToWidth()
+ textField.view.adjustZoomToWidth()
zoomSelectorDialogue.close()
}
@@ -121,7 +115,7 @@
width: units.gu(2); height: width
name: "tick"
color: UbuntuColors.green
- visible: view.zoomMode == LibreOffice.View.FitToWidth
+ visible: textField.view.zoomMode == LibreOffice.View.FitToWidth
}
}
} // ListItem
@@ -147,7 +141,7 @@
height: units.gu(4)
onClicked: {
- view.setZoom(modelData.value)
+ textField.view.setZoom(modelData.value)
zoomSelectorDialogue.close()
}
=== added directory 'src/app/qml/loView/graphics'
=== added file 'src/app/qml/loView/graphics/libreoffice.png'
Binary files src/app/qml/loView/graphics/libreoffice.png 1970-01-01 00:00:00 +0000 and src/app/qml/loView/graphics/libreoffice.png 2015-11-30 12:25:27 +0000 differ
=== modified file 'src/app/qml/ubuntu-docviewer-app.qml'
--- src/app/qml/ubuntu-docviewer-app.qml 2015-11-27 16:39:21 +0000
+++ src/app/qml/ubuntu-docviewer-app.qml 2015-11-30 12:25:27 +0000
@@ -30,6 +30,9 @@
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)
readonly property bool isLandscape: Screen.orientation == Qt.LandscapeOrientation ||
Screen.orientation == Qt.InvertedLandscapeOrientation
References