ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #06006
[Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk13 into lp:ubuntu-docviewer-app/reboot
Stefano Verzegnassi has proposed merging lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk13 into lp:ubuntu-docviewer-app/reboot.
Commit message:
* Switch to Ubuntu Toolkit 1.3
* UI updated
* Improved support for zoom on desktop
* Updated framework to 14.04.1
* Moved components in the 'upstreamComponents' folder into 'common'
* Use the new BottomEdgeHint component in order to provide mouse/keyb controls for the bottom edge.
* Changed Header behaviour to default in the PDF viewer
* Use an horizontal PartsView for switching slides in portrait, small-width mode, instead of using the SlideControllerPanel component + BottomEdge.
* Removed some obsolete code
Requested reviews:
Roman Shchekin (mrqtros)
Related bugs:
Bug #1453403 in Ubuntu Document Viewer App: "[SDK] Tap to hide toolbar is inconsistent"
https://bugs.launchpad.net/ubuntu-docviewer-app/+bug/1453403
Bug #1508363 in Ubuntu Document Viewer App: "Coordinated migration to UITK 1.3"
https://bugs.launchpad.net/ubuntu-docviewer-app/+bug/1508363
Bug #1513843 in Ubuntu Document Viewer App: "Slide navigation buttons obscured by bottom edge tab"
https://bugs.launchpad.net/ubuntu-docviewer-app/+bug/1513843
For more details, see:
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk13/+merge/275531
DO NOT MERGE.
This MP may become very huge since there are big changes with ListItem(s), because of the introduction of ListItemLayout.
For that reason I will ask multiple reviews in order to split the diff into small parts.
The version of the toolkit we target is 1.3.1676+15.04.20151008-0ubuntu1, included in OTA-7.
Link: http://bazaar.launchpad.net/~ubuntu-sdk-team/ubuntu-ui-toolkit/staging/files/1676
Changes:
* Updated all the 'Ubuntu.*' imports to verstion 1.3
* New ZoomSelector UI
* Usage of the new enum 'textSize' property instead of string 'fontSize' in Labels
* Better support for zoom on desktop
* Usage of 'theme' singleton instead of deprecated 'Theme'
* Updated framework to 14.04.1
* Moved components in the 'upstreamComponents' folder into 'common'
* Use BottomEdgeHint in order to provide mouse/keyb controls for the bottom edge.
* Changed Header behaviour to default in the PDF viewer (the way we did the 'tap to show/hide' is broken with the upcoming UITK release)
* Use an horizontal PartsView for switching slides in portrait, small-width mode, instead of using the SlideControllerPanel component + BottomEdge.
WILL COME WITH SEPARATE MPs:
* Move all async logic used in LoViewPage in another component
* Fix broken Autopilot tests: it will be done in a following MP
* Update translation template: it will be done in a following MP
--
Your team Ubuntu Document Viewer Developers is subscribed to branch lp:ubuntu-docviewer-app/reboot.
=== modified file 'debian/control'
--- debian/control 2015-09-19 14:54:11 +0000
+++ debian/control 2015-11-13 21:19:59 +0000
@@ -26,7 +26,7 @@
Package: ubuntu-docviewer-app
Architecture: any
Depends: qtdeclarative5-qtquick2-plugin,
- qtdeclarative5-ubuntu-ui-toolkit-plugin,
+ qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1676) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1676),
qtdeclarative5-ubuntu-content1,
qtdeclarative5-quicklayouts-plugin,
qtdeclarative5-window-plugin,
=== modified file 'docviewer.apparmor'
--- docviewer.apparmor 2015-11-06 10:59:14 +0000
+++ docviewer.apparmor 2015-11-13 21:19:59 +0000
@@ -12,5 +12,5 @@
"write_path": [
"@{HOME}/Documents/"
],
- "policy_version": 1.2
-}
+ "policy_version": 1.3
+}
\ No newline at end of file
=== modified file 'manifest.json.in'
--- manifest.json.in 2015-02-13 15:30:01 +0000
+++ manifest.json.in 2015-11-13 21:19:59 +0000
@@ -2,7 +2,7 @@
"name": "com.ubuntu.docviewer",
"title": "Document Viewer",
"description": "Document Viewer application for Ubuntu devices",
- "framework": "ubuntu-sdk-14.10",
+ "framework": "ubuntu-sdk-15.04.1",
"architecture": "@CLICK_ARCH@",
"icon": "@ICON@",
"hooks": {
=== modified file 'src/app/qml/common/CommandLineProxy.qml'
--- src/app/qml/common/CommandLineProxy.qml 2015-10-17 00:45:46 +0000
+++ src/app/qml/common/CommandLineProxy.qml 2015-11-13 21:19:59 +0000
@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.3
Item {
id: rootItem
=== modified file 'src/app/qml/common/DetailsPage.qml'
--- src/app/qml/common/DetailsPage.qml 2015-10-19 23:07:50 +0000
+++ src/app/qml/common/DetailsPage.qml 2015-11-13 21:19:59 +0000
@@ -15,7 +15,7 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
import "utils.js" as Utils
=== renamed file 'src/app/qml/upstreamComponents/EmptyState.qml' => 'src/app/qml/common/EmptyState.qml'
--- src/app/qml/upstreamComponents/EmptyState.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/common/EmptyState.qml 2015-11-13 21:19:59 +0000
@@ -17,7 +17,7 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
/*
Component which displays an empty state (approved by design). It offers an
@@ -47,7 +47,7 @@
anchors.top: emptyIcon.bottom
anchors.topMargin: units.gu(5)
anchors.horizontalCenter: parent.horizontalCenter
- fontSize: "large"
+ textSize: Label.Large
font.bold: true
}
=== modified file 'src/app/qml/common/FileNotFoundDialog.qml'
--- src/app/qml/common/FileNotFoundDialog.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/common/FileNotFoundDialog.qml 2015-11-13 21:19:59 +0000
@@ -15,8 +15,8 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.Popups 1.0
+import Ubuntu.Components 1.3
+import Ubuntu.Components.Popups 1.3
// We may want to refactor this dialog for a more generic usage, when we'll need it.
Dialog {
=== added file 'src/app/qml/common/HorizontalDivider.qml'
--- src/app/qml/common/HorizontalDivider.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/common/HorizontalDivider.qml 2015-11-13 21:19:59 +0000
@@ -0,0 +1,28 @@
+/*
+ * 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
+
+Rectangle {
+ height: units.dp(2)
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.rgba(0, 0, 0, 0.1) }
+ GradientStop { position: 0.49; color: Qt.rgba(0, 0, 0, 0.1) }
+ GradientStop { position: 0.5; color: Qt.rgba(1, 1, 1, 0.4) }
+ GradientStop { position: 1.0; color: Qt.rgba(1, 1, 1, 0.4) }
+ }
+}
=== renamed file 'src/app/qml/upstreamComponents/PageWithBottomEdge.qml' => 'src/app/qml/common/PageWithBottomEdge.qml'
--- src/app/qml/upstreamComponents/PageWithBottomEdge.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/common/PageWithBottomEdge.qml 2015-11-13 21:19:59 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014 Canonical, Ltd.
+ * Copyright (C) 2014, 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
@@ -63,14 +63,14 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
Page {
id: page
property alias bottomEdgePageComponent: edgeLoader.sourceComponent
property alias bottomEdgePageSource: edgeLoader.source
- property alias bottomEdgeTitle: tipLabel.text
+ property alias bottomEdgeTitle: tip.text
property bool bottomEdgeEnabled: true
property int bottomEdgeExpandThreshold: page.height * 0.2
property int bottomEdgeExposedArea: bottomEdge.state !== "expanded" ? (page.height - bottomEdge.y - bottomEdge.tipHeight) : _areaWhenExpanded
@@ -142,50 +142,36 @@
z: 1
}
- UbuntuShape {
+ BottomEdgeHint {
id: tip
objectName: "bottomEdgeTip"
- property bool hidden: (activeFocus === false) || ((bottomEdge.y - units.gu(1)) < tip.y)
-
enabled: mouseArea.enabled
visible: page.bottomEdgeEnabled
- anchors {
- bottom: parent.bottom
- horizontalCenter: bottomEdge.horizontalCenter
- bottomMargin: hidden ? - height + units.gu(1) : -units.gu(1)
- Behavior on bottomMargin {
- SequentialAnimation {
- // wait some msecs in case of the focus change again, to avoid flickering
- PauseAnimation {
- duration: 300
- }
- UbuntuNumberAnimation {
- duration: UbuntuAnimation.SnapDuration
- }
- }
- }
- }
-
z: 1
- width: tipLabel.paintedWidth + units.gu(6)
- height: bottomEdge.tipHeight + units.gu(1)
- color: Theme.palette.normal.overlay
- Label {
- id: tipLabel
-
- anchors {
- top: parent.top
- left: parent.left
- right: parent.right
+
+ onClicked: bottomEdge.state = "expanded"
+
+ Connections {
+ target: mouseArea
+ onClosedChanged: {
+ if (!mouseArea.closed) {
+ tip.state = "Visible";
+ }
}
- height: bottomEdge.tipHeight
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- opacity: tip.hidden ? 0.0 : 1.0
- Behavior on opacity {
- UbuntuNumberAnimation {
- duration: UbuntuAnimation.SnapDuration
+ }
+
+ Connections {
+ target: page.flickable
+ onVerticalVelocityChanged: {
+ if (!mouseArea.closed) {
+ return;
+ }
+
+ if (page.flickable.verticalVelocity > 0) {
+ tip.state = "Hidden";
+ } else if (page.flickable.verticalVelocity < 0) {
+ tip.state = "Visible";
}
}
}
@@ -213,6 +199,7 @@
property real previousY: -1
property string dragDirection: "None"
+ property bool closed: drag.target.y == drag.maximumY && !mouseArea.pressed
preventStealing: true
drag {
@@ -231,7 +218,7 @@
}
height: bottomEdge.tipHeight
- z: 1
+ z: 10
onReleased: {
page.bottomEdgeReleased()
@@ -250,6 +237,9 @@
tip.forceActiveFocus()
}
+ // Propagate click event to the BottomEdgeHint
+ onClicked: tip.clicked()
+
onMouseYChanged: {
var yOffset = previousY - mouseY
// skip if was a small move
@@ -268,8 +258,8 @@
readonly property int tipHeight: units.gu(3)
readonly property int pageStartY: 0
- z: 1
- color: Theme.palette.normal.background
+ z: Number.MAX_VALUE
+ color: theme.palette.normal.background
clip: true
anchors {
left: parent.left
=== modified file 'src/app/qml/common/PickImportedDialog.qml'
--- src/app/qml/common/PickImportedDialog.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/common/PickImportedDialog.qml 2015-11-13 21:19:59 +0000
@@ -15,8 +15,8 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.Popups 1.0
+import Ubuntu.Components 1.3
+import Ubuntu.Components.Popups 1.3
import "utils.js" as Utils
=== modified file 'src/app/qml/common/RejectedImportDialog.qml'
--- src/app/qml/common/RejectedImportDialog.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/common/RejectedImportDialog.qml 2015-11-13 21:19:59 +0000
@@ -15,8 +15,8 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.Popups 1.0
+import Ubuntu.Components 1.3
+import Ubuntu.Components.Popups 1.3
Dialog {
id: rejectedDialog
=== added file 'src/app/qml/common/ResizeableSidebar.qml'
--- src/app/qml/common/ResizeableSidebar.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/common/ResizeableSidebar.qml 2015-11-13 21:19:59 +0000
@@ -0,0 +1,98 @@
+/*
+ * 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
+
+Item {
+ id: resizeableSidebar
+
+ /* Please remember to set left or right anchor */
+ anchors { top: parent.top; bottom: parent.bottom }
+
+ property int minimumWidth: units.gu(20)
+ property int maximumWidth: units.gu(40)
+
+ width: visible ? units.gu(40) : 0
+
+ Rectangle {
+ id: verticalDivider
+ anchors {
+ top: parent.top
+ bottom: parent.bottom
+ right: resizeableSidebar.anchors.left ? parent.right : undefined
+ left: resizeableSidebar.anchors.left ? undefined : parent.left
+ leftMargin: units.dp(2)
+ rightMargin: units.dp(2)
+ }
+ width: units.dp(2)
+ color: Theme.palette.selected.background
+
+ // Stay above the sidebar content
+ z: 10
+
+ MouseArea {
+ id: resizerSensing
+ objectName: "Divider"
+ enabled: verticalDivider.width > 0
+ anchors {
+ fill: parent
+ leftMargin: enabled ? -units.gu(1) : 0
+ rightMargin: enabled ? -units.gu(1) : 0
+ }
+ cursorShape: Qt.SizeHorCursor
+ drag {
+ axis: Drag.XAxis
+ target: resizer
+ smoothed: false
+ minimumX: resizeableSidebar.minimumWidth
+ maximumX: resizeableSidebar.maximumWidth
+ }
+ onPressed: resizer.x = resizeableSidebar.width
+ }
+ states: State {
+ name: "active"
+ when: resizerSensing.pressed || resizerSensing.containsMouse
+ PropertyChanges {
+ target: verticalDivider
+ color: Qt.darker(Theme.palette.normal.background, 1.5)
+ }
+ }
+ transitions: Transition {
+ from: ""
+ to: "*"
+ reversible: true
+ ColorAnimation {
+ target: verticalDivider
+ property: "color"
+ duration: UbuntuAnimation.SlowDuration
+ }
+ }
+ }
+ Item {
+ id: resizer
+ height: parent.height
+ onXChanged: resizeableSidebar.width = x
+ }
+
+ VerticalDivider {
+ anchors {
+ top: parent.top
+ bottom: parent.bottom
+ right: parent.right
+ }
+ }
+}
=== modified file 'src/app/qml/common/SubtitledListItem.qml'
--- src/app/qml/common/SubtitledListItem.qml 2015-10-19 23:07:50 +0000
+++ src/app/qml/common/SubtitledListItem.qml 2015-11-13 21:19:59 +0000
@@ -15,7 +15,7 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
ListItem {
id: listItemSubtitled
@@ -35,7 +35,7 @@
}
Label {
id: subLabel
- fontSize: "small"
+ textSize: Label.Small
}
}
}
=== added file 'src/app/qml/common/TextFieldButtonPopover.qml'
--- src/app/qml/common/TextFieldButtonPopover.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/common/TextFieldButtonPopover.qml 2015-11-13 21:19:59 +0000
@@ -0,0 +1,58 @@
+/*
+ * 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
+import Ubuntu.Components.Popups 1.3
+
+Popover {
+ id: textFieldButtonPopover
+
+ default property alias popoverData: layout.data
+
+ signal close()
+
+ autoClose: false
+ contentHeight: layout.height + units.gu(4)
+ contentWidth: units.gu(24)
+
+ onClose: PopupUtils.close(textFieldButtonPopover)
+
+ // We don't use 'autoClose' property, since we want to propagate
+ // mouse/touch events to other items (e.g. when zoomSelectorDialogue
+ // is visible, and user taps the zoom+ button on its right, we want
+ // the zoom button to receive the event).
+ InverseMouseArea {
+ anchors.fill: parent
+ propagateComposedEvents: true
+
+ onPressed: {
+ mouse.accepted = false
+ PopupUtils.close(textFieldButtonPopover)
+ }
+ }
+
+ Column {
+ id: layout
+ spacing: units.gu(0.5)
+ anchors {
+ top: parent.top
+ left: parent.left
+ right: parent.right
+ margins: units.gu(2)
+ }
+ }
+}
=== added file 'src/app/qml/common/TextFieldWithRightButton.qml'
--- src/app/qml/common/TextFieldWithRightButton.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/common/TextFieldWithRightButton.qml 2015-11-13 21:19:59 +0000
@@ -0,0 +1,84 @@
+/*
+ * 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
+import Ubuntu.Components.Popups 1.3
+import Ubuntu.Components.Themes.Ambiance 1.3 as Theme
+
+TextField {
+ id: textField
+
+ // FIXME: This property is meant to be read-only, but we need to set its value herein.
+ property bool expanded: false
+
+ property Component popover
+
+ secondaryItem: AbstractButton {
+ id: popoverButton
+
+ height: parent.height
+ visible: !textField.highlighted
+ width: visible ? height : 0
+
+ onClicked: {
+ textField.expanded = !textField.expanded
+
+ if (textField.expanded) {
+ var dialog = PopupUtils.open(textField.popover, popoverButton)
+
+ dialog.Component.onDestruction.connect(function() {
+ textField.expanded = false
+ })
+ }
+ }
+
+ VerticalDivider { anchors { top: parent.top; bottom: parent.bottom; left: parent.left } }
+
+ Rectangle {
+ anchors.fill: parent
+ color: theme.palette.selected.background
+ visible: textField.expanded
+ }
+
+ Icon {
+ width: units.gu(2); height: width
+ anchors.centerIn: parent
+
+ name: "go-down"
+ color: "Grey"
+ rotation: textField.expanded ? 180 : 0
+ Behavior on rotation { UbuntuNumberAnimation { } }
+ }
+ }
+
+ default property alias textFieldData: textFieldContent.data
+ Item {
+ id: textFieldContent
+ anchors {
+ fill: parent
+ rightMargin: popoverButton.width
+ }
+ }
+
+ /* style */
+ style: Theme.TextFieldStyle {
+ background: UbuntuShape {
+ anchors.fill: parent
+ aspect: UbuntuShape.DropShadow
+ }
+ }
+}
=== modified file 'src/app/qml/common/UnknownTypeDialog.qml'
--- src/app/qml/common/UnknownTypeDialog.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/common/UnknownTypeDialog.qml 2015-11-13 21:19:59 +0000
@@ -15,8 +15,8 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.Popups 1.0
+import Ubuntu.Components 1.3
+import Ubuntu.Components.Popups 1.3
import QtQuick.Layouts 1.1
import "loadComponent.js" as LoadComponent
=== added file 'src/app/qml/common/VerticalDivider.qml'
--- src/app/qml/common/VerticalDivider.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/common/VerticalDivider.qml 2015-11-13 21:19:59 +0000
@@ -0,0 +1,35 @@
+/*
+ * 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
+
+Item {
+ width: units.dp(2)
+
+ Rectangle {
+ height: parent.width
+ width: parent.height
+ rotation: 90; anchors.centerIn: parent
+
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.rgba(0, 0, 0, 0.1) }
+ GradientStop { position: 0.49; color: Qt.rgba(0, 0, 0, 0.1) }
+ GradientStop { position: 0.5; color: Qt.rgba(1, 1, 1, 0.4) }
+ GradientStop { position: 1.0; color: Qt.rgba(1, 1, 1, 0.4) }
+ }
+ }
+}
=== modified file 'src/app/qml/documentPage/DeleteFileDialog.qml'
--- src/app/qml/documentPage/DeleteFileDialog.qml 2015-10-14 22:54:00 +0000
+++ src/app/qml/documentPage/DeleteFileDialog.qml 2015-11-13 21:19:59 +0000
@@ -16,8 +16,8 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.Popups 1.0
+import Ubuntu.Components 1.3
+import Ubuntu.Components.Popups 1.3
import QtQuick.Layouts 1.1
Dialog {
=== modified file 'src/app/qml/documentPage/DocumentDelegateActions.qml'
--- src/app/qml/documentPage/DocumentDelegateActions.qml 2015-10-14 22:54:00 +0000
+++ src/app/qml/documentPage/DocumentDelegateActions.qml 2015-11-13 21:19:59 +0000
@@ -15,8 +15,8 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.Popups 1.0
+import Ubuntu.Components 1.3
+import Ubuntu.Components.Popups 1.3
// TODO: Probably requires some change in order to work with latest ListItem 1.2
=== modified file 'src/app/qml/documentPage/DocumentEmptyState.qml'
--- src/app/qml/documentPage/DocumentEmptyState.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/documentPage/DocumentEmptyState.qml 2015-11-13 21:19:59 +0000
@@ -15,7 +15,7 @@
*/
import QtQuick 2.4
-import "../upstreamComponents"
+import "../common"
Item {
anchors.fill: parent
=== modified file 'src/app/qml/documentPage/DocumentListDelegate.qml'
--- src/app/qml/documentPage/DocumentListDelegate.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/documentPage/DocumentListDelegate.qml 2015-11-13 21:19:59 +0000
@@ -15,7 +15,7 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
import QtQuick.Layouts 1.1
import DocumentViewer 1.0
@@ -57,7 +57,7 @@
}
Label {
text: Utils.printSize(i18n, model.size)
- fontSize: "small"
+ textSize: Label.Small
}
}
@@ -65,7 +65,7 @@
width: parent.width
Label {
text: internal.formattedDateTime()
- fontSize: "small"
+ textSize: Label.Small
Layout.fillWidth: true
}
=== modified file 'src/app/qml/documentPage/DocumentListView.qml'
--- src/app/qml/documentPage/DocumentListView.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/documentPage/DocumentListView.qml 2015-11-13 21:19:59 +0000
@@ -15,9 +15,7 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
-
-import "../upstreamComponents"
+import Ubuntu.Components 1.3
ListView {
id: documentListView
=== modified file 'src/app/qml/documentPage/DocumentPage.qml'
--- src/app/qml/documentPage/DocumentPage.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/documentPage/DocumentPage.qml 2015-11-13 21:19:59 +0000
@@ -15,7 +15,7 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
import Qt.labs.settings 1.0
Page {
@@ -52,7 +52,7 @@
if (folderModel.count === 0) {
return documentPage.state == "search"
? Qt.resolvedUrl("SearchEmptyState.qml")
- : Qt.resolvedUrl("BrowserEmptyState.qml")
+ : Qt.resolvedUrl("DocumentEmptyState.qml")
}
return Qt.resolvedUrl("DocumentListView.qml")
=== modified file 'src/app/qml/documentPage/DocumentPageDefaultHeader.qml'
--- src/app/qml/documentPage/DocumentPageDefaultHeader.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/documentPage/DocumentPageDefaultHeader.qml 2015-11-13 21:19:59 +0000
@@ -15,8 +15,8 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.Popups 1.0
+import Ubuntu.Components 1.3
+import Ubuntu.Components.Popups 1.3
PageHeadState {
id: rootItem
=== modified file 'src/app/qml/documentPage/DocumentPagePickModeHeader.qml'
--- src/app/qml/documentPage/DocumentPagePickModeHeader.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/documentPage/DocumentPagePickModeHeader.qml 2015-11-13 21:19:59 +0000
@@ -15,7 +15,7 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
import Ubuntu.Content 1.1
PageHeadState {
=== modified file 'src/app/qml/documentPage/DocumentPageSearchHeader.qml'
--- src/app/qml/documentPage/DocumentPageSearchHeader.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/documentPage/DocumentPageSearchHeader.qml 2015-11-13 21:19:59 +0000
@@ -15,7 +15,7 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
PageHeadState {
id: rootItem
=== modified file 'src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml'
--- src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml 2015-11-13 21:19:59 +0000
@@ -15,10 +15,8 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.Popups 1.0
-
-import "../upstreamComponents"
+import Ubuntu.Components 1.3
+import Ubuntu.Components.Popups 1.3
PageHeadState {
id: rootItem
=== modified file 'src/app/qml/documentPage/SearchEmptyState.qml'
--- src/app/qml/documentPage/SearchEmptyState.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/documentPage/SearchEmptyState.qml 2015-11-13 21:19:59 +0000
@@ -15,7 +15,7 @@
*/
import QtQuick 2.4
-import "../upstreamComponents"
+import "../common"
Item {
anchors.fill: parent
=== modified file 'src/app/qml/documentPage/SectionHeader.qml'
--- src/app/qml/documentPage/SectionHeader.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/documentPage/SectionHeader.qml 2015-11-13 21:19:59 +0000
@@ -1,6 +1,6 @@
import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.ListItems 1.0 as ListItem
+import Ubuntu.Components 1.3
+import Ubuntu.Components.ListItems 1.3 as ListItem
import DocumentViewer 1.0
ListItem.Header {
=== modified file 'src/app/qml/documentPage/SharePage.qml'
--- src/app/qml/documentPage/SharePage.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/documentPage/SharePage.qml 2015-11-13 21:19:59 +0000
@@ -15,7 +15,7 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
import Ubuntu.Content 1.1
Page {
=== modified file 'src/app/qml/documentPage/SortSettingsDialog.qml'
--- src/app/qml/documentPage/SortSettingsDialog.qml 2015-10-18 22:36:11 +0000
+++ src/app/qml/documentPage/SortSettingsDialog.qml 2015-11-13 21:19:59 +0000
@@ -16,8 +16,8 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.Popups 1.0
+import Ubuntu.Components 1.3
+import Ubuntu.Components.Popups 1.3
import QtQuick.Layouts 1.1
Dialog {
=== modified file 'src/app/qml/loView/LOViewDefaultHeader.qml'
--- src/app/qml/loView/LOViewDefaultHeader.qml 2015-10-19 11:30:01 +0000
+++ src/app/qml/loView/LOViewDefaultHeader.qml 2015-11-13 21:19:59 +0000
@@ -15,9 +15,11 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.Popups 1.0
+import Ubuntu.Components 1.3
+import QtQuick.Layouts 1.1
+import Ubuntu.Components.Popups 1.3
import DocumentViewer.LibreOffice 1.0 as LibreOffice
+import DocumentViewer 1.0
PageHeadState {
id: rootItem
@@ -25,14 +27,16 @@
property Page targetPage
head: targetPage.head
- contents: Column {
- anchors {
- left: parent.left
- right: parent.right
- verticalCenter: parent.verticalCenter
- }
-
- Label {
+ contents: RowLayout {
+ anchors.fill: parent
+ anchors.rightMargin: units.gu(2)
+ spacing: units.gu(1)
+
+ Column {
+ id: layout
+ Layout.fillWidth: true
+
+ Label {
anchors { left: parent.left; right: parent.right }
elide: Text.ElideMiddle
font.weight: Font.DemiBold
@@ -41,7 +45,7 @@
Label {
anchors { left: parent.left; right: parent.right }
elide: Text.ElideMiddle
- fontSize: "small"
+ textSize: Label.Small
text: {
if (!loPageContentLoader.item)
return i18n.tr("Loading...")
@@ -59,33 +63,30 @@
return i18n.tr("Unknown LibreOffice document")
default:
return i18n.tr("Unknown type document")
+ }
}
}
}
- }
-
-
- backAction: Action {
- iconName: "back"
- text: (pageStack.depth > 1) ? i18n.tr("Back") : i18n.tr("Close")
- onTriggered: {
- if (pageStack.depth > 1) {
- // Go back to Welcome page
- pageStack.pop();
- } else {
- // File has been imported through Content Hub (or was not chosen through WelcomePage)
- // Close the application and show our source app (e.g. ubuntu-filemanager-app, if used to open a document)
- Qt.quit()
+
+ ZoomSelector {
+ Layout.preferredWidth: units.gu(12)
+ Layout.preferredHeight: units.gu(4)
+
+ visible: {
+ if (!loPageContentLoader.item)
+ return false
+
+ return DocumentViewer.desktopMode || targetPage.width > units.gu(80)
}
}
}
actions: [
- Action {
- iconName: "zoom-in"
- text: i18n.tr("Show zoom controls")
- onTriggered: targetPage.state = "zoom"
- },
+ /* Action {
+ iconName: "Search"
+ text: i18n.tr("Search")
+ enabled: false
+ },*/
Action {
objectName: "gotopage"
=== modified file 'src/app/qml/loView/LOViewGotoDialog.qml'
--- src/app/qml/loView/LOViewGotoDialog.qml 2015-10-19 11:30:01 +0000
+++ src/app/qml/loView/LOViewGotoDialog.qml 2015-11-13 21:19:59 +0000
@@ -15,8 +15,8 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.Popups 1.0
+import Ubuntu.Components 1.3
+import Ubuntu.Components.Popups 1.3
import QtQuick.Layouts 1.1
// TODO: Use page breaks detection, when LibreOfficeKit will support it.
=== modified file 'src/app/qml/loView/LOViewPage.qml'
--- src/app/qml/loView/LOViewPage.qml 2015-10-19 11:44:11 +0000
+++ src/app/qml/loView/LOViewPage.qml 2015-11-13 21:19:59 +0000
@@ -15,31 +15,21 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
import Ubuntu.Layouts 1.0
import DocumentViewer.LibreOffice 1.0 as LibreOffice
-import "../upstreamComponents"
-
+import "../common"
import "../common/utils.js" as Utils
import "KeybHelper.js" as KeybHelper
-PageWithBottomEdge {
+Page {
id: loPage
title: Utils.getNameOfFile(file.path);
flickable: null
readonly property bool wideWindow: width > units.gu(120)
- bottomEdgeTitle: i18n.tr("Slides")
- bottomEdgeEnabled: {
- if (!loPageContentLoader.loaded)
- return false
-
- // else
- return loPageContentLoader.item.loDocument.documentType == LibreOffice.Document.PresentationDocument && !wideWindow
- }
-
Loader {
id: loPageContentLoader
@@ -52,12 +42,7 @@
// 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
-
- loPage.bottomEdgePageComponent = item.bottomEdgePartsPage
-
- } else {
- loPage.flickable = null
- }
+ } else loPage.flickable = null
}
}
@@ -76,7 +61,6 @@
property alias loDocument: loView.document
property alias loView: loView
- property alias bottomEdgePartsPage: bottomEdgePartsPage
Layouts {
id: layouts
@@ -90,59 +74,36 @@
Item {
anchors.fill: parent
- // TODO: Add a setting to show/hide sidebar when width > units.gu(80)
- PartsView {
- id: partsView
- anchors {
- top: parent.top
- bottom: bottomBarLayoutItem.top
- left: parent.left
- }
-
- model: loView.partsModel
+ ResizeableSidebar {
+ id: leftSidebar
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
visible: loDocument.documentType == LibreOffice.Document.PresentationDocument
- width: visible ? units.gu(40) : 0
- }
-
- Item {
- anchors {
- left: partsView.right
- right: parent.right
- top: parent.top
- bottom: bottomBarLayoutItem.top
- }
-
- ItemLayout {
- item: "loView"
+
+ PartsView {
+ id: partsView
anchors.fill: parent
-
- // Keyboard events
- focus: true
- Keys.onPressed: KeybHelper.parseEvent(event)
- Component.onCompleted: loPageContent.forceActiveFocus()
+ model: loView.partsModel
}
}
- Item {
- id: bottomBarLayoutItem
- visible: loDocument.documentType == LibreOffice.Document.PresentationDocument
- height: visible ? units.gu(5) : 0
+ ItemLayout {
+ item: "pinchy"
anchors {
- left: parent.left
+ left: leftSidebar.right
right: parent.right
+ top: parent.top
bottom: parent.bottom
}
-
- ItemLayout { item: "bottomBar"; anchors.fill: parent }
}
}
}
]
- LibreOffice.Viewer {
- id: loView
- objectName: "loView"
- Layouts.item: "loView"
+ PinchArea {
+ id: pinchy
+ Layouts.item: "pinchy"
+
anchors {
left: parent.left
right: parent.right
@@ -150,55 +111,75 @@
bottom: bottomBar.top
}
- clip: true
- documentPath: file.path
-
- // 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()
+ // Limits for pinch-to-zoom
+ // FIXME: We should get these limits from the C++ LibreOffice Viewer class
+ property real minimumZoom: 0.5
+ property real maximumZoom: 4.0
+
+ LibreOffice.Viewer {
+ id: loView
+ objectName: "loView"
+ anchors.fill: parent
+
+ clip: true
+ documentPath: file.path
+
+ Behavior on zoomFactor {
+ UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration }
+ }
+
+ Component.onCompleted: {
+ // WORKAROUND: Fix for wrong grid unit size
+ flickDeceleration = 1500 * units.gridUnit / 8
+ maximumFlickVelocity = 2500 * units.gridUnit / 8
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+
+ onDoubleClicked: {
+ // Limit zoom by double-click to 3.0x factor
+ if (loView.zoomFactor < pinchy.maximumZoom) {
+ var scaleRatio = 3.0 / loView.zoomFactor
+
+ loView.contentX += mouse.x * (scaleRatio - 1)
+ loView.contentY += mouse.y * (scaleRatio - 1)
+
+ loView.zoomFactor = 3.0
+ } else loView.adjustZoomToWidth()
+ }
+
+ /* Keyboard events */
+ focus: true
+ Keys.onPressed: KeybHelper.parseEvent(event)
+ Component.onCompleted: loPageContent.forceActiveFocus()
+ }
+
+ Scrollbar { flickableItem: loView; parent: loView.parent }
+ Scrollbar { flickableItem: loView; parent: loView.parent; align: Qt.AlignBottom }
}
-
- Scrollbar { flickableItem: loView; parent: loView.parent }
- Scrollbar { flickableItem: loView; parent: loView.parent; align: Qt.AlignBottom }
}
- // TODO: When we'll have to merge this with the zooming branch, replace this
- // and use a single bottom panel
- SlideControllerPanel {
+ PartsView {
id: bottomBar
- Layouts.item: "bottomBar"
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
+ height: visible ? units.gu(12) : 0
visible: loDocument.documentType == LibreOffice.Document.PresentationDocument
- height: visible ? units.gu(5) : 0
- anchors {
- left: parent.left
- right: parent.right
- bottom: parent.bottom
- }
- }
- }
-
- Component {
- id: bottomEdgePartsPage
- Page {
- title: i18n.tr("Slides")
- head.backAction: Action {
- text: i18n.tr("Back")
- iconName: "down"
- onTriggered: pageStack.pop()
- }
-
- flickable: null
-
- PartsView {
- property bool belongsToNestedPage: true
- anchors.fill: parent
- model: loView.partsModel
+
+ model: loView.partsModel
+ orientation: ListView.Horizontal
+
+ HorizontalDivider {
+ anchors {
+ left: parent.left
+ right: parent.right
+ top: parent.top
+ }
}
}
}
@@ -211,11 +192,6 @@
LOViewDefaultHeader {
name: "default"
targetPage: loPage
- },
-
- LOViewZoomHeader {
- name: "zoom"
- targetPage: loPage
}
]
}
=== removed file 'src/app/qml/loView/LOViewZoomHeader.qml'
--- src/app/qml/loView/LOViewZoomHeader.qml 2015-10-19 11:44:11 +0000
+++ src/app/qml/loView/LOViewZoomHeader.qml 1970-01-01 00:00:00 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2014-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.2
-import QtQuick.Layouts 1.1
-import Ubuntu.Components.Popups 1.0
-
-PageHeadState {
- id: rootItem
-
- property Page targetPage
- head: targetPage.head
-
- contents: Item {
- anchors.fill: parent
-
- ZoomSelector {
- width: units.gu(24)
- anchors {
- right: parent.right
- verticalCenter: parent.verticalCenter
- }
- }
- }
-
- backAction: Action {
- iconName: "close"
- text: i18n.tr("Hide zoom controls")
- onTriggered: targetPage.state = "default"
- }
-
- actions: [
- Action {
- iconName: "zoom-in"
- text: i18n.tr("Zoom in")
- onTriggered: loPageContentLoader.item.loView.zoomFactor += 0.1
- },
-
- Action {
- iconName: "zoom-out"
- text: i18n.tr("Zoom out")
- onTriggered: loPageContentLoader.item.loView.zoomFactor -= 0.1
- }
- ]
-}
=== modified file 'src/app/qml/loView/PanelButton.qml'
--- src/app/qml/loView/PanelButton.qml 2015-10-19 11:44:11 +0000
+++ src/app/qml/loView/PanelButton.qml 2015-11-13 21:19:59 +0000
@@ -15,7 +15,7 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
AbstractButton {
width: units.gu(4); height: parent.height
=== modified file 'src/app/qml/loView/PartsView.qml'
--- src/app/qml/loView/PartsView.qml 2015-10-19 11:44:11 +0000
+++ src/app/qml/loView/PartsView.qml 2015-11-13 21:19:59 +0000
@@ -15,7 +15,7 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
import QtQuick.Layouts 1.1
import DocumentViewer.LibreOffice 1.0 as LibreOffice
@@ -26,66 +26,120 @@
property bool expanded: true
+ orientation: ListView.Vertical
+
+ // used in vertical mode
+ property bool isWide: width > units.gu(24)
+
currentIndex: view.model ? loView.document.currentPart : -1
highlightMoveDuration: UbuntuAnimation.SnapDuration
- delegate: ListItem {
- id: delegate
-
- width: parent.width
- height: units.gu(16)
-
- color: (loView.document.currentPart === model.index) ? Theme.palette.selected.background
- : "transparent"
-
- AbstractButton {
- objectName: "abstractbutton"
- anchors.fill: parent
-
- onClicked: {
- loView.document.currentPart = model.index
-
- // Check if the view has been included in a nested page (e.g.
- // bottomEdge). If so, close that page and return to the
- // main viewer.
- if (view.hasOwnProperty("belongsToNestedPage"))
- pageStack.pop();
- }
- }
-
- RowLayout {
- anchors {
- fill: parent
- leftMargin: units.gu(1)
- rightMargin: units.gu(1)
- }
- spacing: units.gu(1)
-
- Image {
- Layout.fillHeight: true
- Layout.preferredWidth: height
- fillMode: Image.PreserveAspectFit
- // Do not store a cache of the thumbnail, so that we don't show
- // thumbnails of a previously loaded document.
- cache: true // TODO PLAY WITH IT
- source: model.thumbnail
- }
-
- Label {
- Layout.fillWidth: true
- wrapMode: Text.WordWrap
- text: model.name
- color: (loView.document.currentPart === model.index) ? UbuntuColors.orange
- : Theme.palette.selected.backgroundText
- }
-
- Label {
- text: model.index + 1
- color: (loView.document.currentPart === model.index) ? UbuntuColors.orange
- : Theme.palette.selected.backgroundText
- }
- }
- }
+ delegate: (orientation == ListView.Vertical) ? verticalDelegate : horizontalDelegate
+
+ Component {
+ id: verticalDelegate
+
+ ListItem {
+ id: delegate
+ width: parent.width
+ height: units.gu(16)
+
+ color: (loView.document.currentPart === model.index) ? theme.palette.selected.background
+ : "transparent"
+
+ onClicked: internal.delegate_onClicked(model.index)
+
+ RowLayout {
+ anchors {
+ fill: parent
+ leftMargin: units.gu(1)
+ rightMargin: units.gu(1)
+ }
+ spacing: units.gu(1)
+
+ Image {
+ Layout.fillHeight: true
+ Layout.preferredWidth: height
+ fillMode: Image.PreserveAspectFit
+ // Do not store a cache of the thumbnail, so that we don't show
+ // thumbnails of a previously loaded document.
+ cache: true // TODO PLAY WITH IT
+ source: model.thumbnail
+ }
+
+ Label {
+ Layout.fillWidth: true
+ wrapMode: Text.WordWrap
+ text: model.name
+ visible: view.isWide
+ color: (loView.document.currentPart === model.index) ? UbuntuColors.orange
+ : theme.palette.selected.backgroundText
+ }
+
+ Label {
+ text: model.index + 1
+ color: (loView.document.currentPart === model.index) ? UbuntuColors.orange
+ : theme.palette.selected.backgroundText
+ }
+ }
+ }
+ }
+
+ Component {
+ id: horizontalDelegate
+
+ ListItem {
+ id: delegate
+ height: parent.height; width: height
+
+ color: (loView.document.currentPart === model.index) ? theme.palette.selected.background
+ : "transparent"
+
+ onClicked: internal.delegate_onClicked(model.index)
+
+ ColumnLayout {
+ anchors {
+ fill: parent
+ topMargin: units.gu(1)
+ leftMargin: units.gu(2)
+ rightMargin: units.gu(2)
+ }
+ spacing: units.gu(0.5)
+
+ Image {
+ Layout.fillWidth: true
+ Layout.preferredHeight: width
+ fillMode: Image.PreserveAspectFit
+ // Do not store a cache of the thumbnail, so that we don't show
+ // thumbnails of a previously loaded document.
+ cache: true // TODO PLAY WITH IT
+ source: model.thumbnail
+ }
+
+ Label {
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
+ text: model.index + 1
+ color: (loView.document.currentPart === model.index) ? UbuntuColors.orange
+ : theme.palette.selected.backgroundText
+ }
+ }
+ }
+ }
+
+ QtObject {
+ id: internal
+
+ function delegate_onClicked(index) {
+ loView.document.currentPart = index
+
+ // Check if the view has been included in a nested page (e.g.
+ // bottomEdge). If so, close that page and return to the
+ // main viewer.
+ if (view.hasOwnProperty("belongsToNestedPage"))
+ pageStack.pop();
+ }
+ }
+
Scrollbar { flickableItem: view; parent: view.parent }
}
=== removed file 'src/app/qml/loView/SlideControllerPanel.qml'
--- src/app/qml/loView/SlideControllerPanel.qml 2015-10-19 11:44:11 +0000
+++ src/app/qml/loView/SlideControllerPanel.qml 1970-01-01 00:00:00 +0000
@@ -1,87 +0,0 @@
-/*
- * 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.2
-import QtQuick.Layouts 1.1
-import Ubuntu.Components.ListItems 1.0 as ListItems
-
-Rectangle {
- id: bottomBar
- color: "transparent"
- height: units.gu(5)
-
- ListItems.ThinDivider {
- anchors {
- top: parent.top
- left: parent.left
- right: parent.right
- }
- }
-
- Row {
- anchors.centerIn: parent
- //spacing: units.gu(2)
-
- AbstractButton {
- width: units.gu(4); height: parent.height
- onClicked: loPageContentLoader.item.loView.goFirstPart()
-
- Icon {
- anchors.centerIn: parent
- width: units.gu(2.5); height: width
- name: "go-first"
- }
- }
-
- AbstractButton {
- width: units.gu(4); height: parent.height
- onClicked: loPageContentLoader.item.loView.goPreviousPart()
-
- Icon {
- anchors.centerIn: parent
- width: units.gu(2.5); height: width
- name: "go-previous"
- }
- }
-
- Label {
- text: i18n.tr("Slide %1 of %2").arg(loPageContentLoader.item.loDocument.currentPart + 1).arg(loPageContentLoader.item.loDocument.partsCount)
- }
-
- AbstractButton {
- width: units.gu(4); height: parent.height
- onClicked: loPageContentLoader.item.loView.goNextPart()
-
- Icon {
- anchors.centerIn: parent
- width: units.gu(2.5); height: width
- name: "go-next"
- }
- }
-
- AbstractButton {
- width: units.gu(4); height: parent.height
- onClicked: loPageContentLoader.item.loView.goLastPart()
-
- Icon {
- anchors.centerIn: parent
- width: units.gu(2.5); height: width
- name: "go-last"
- }
- }
- }
-}
=== modified file 'src/app/qml/loView/ZoomSelector.qml'
--- src/app/qml/loView/ZoomSelector.qml 2015-10-19 11:44:11 +0000
+++ src/app/qml/loView/ZoomSelector.qml 2015-11-13 21:19:59 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015 Canonical, Ltd.
+ * 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
@@ -15,135 +15,150 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.Popups 1.0
+import Ubuntu.Components 1.3
+import QtQuick.Layouts 1.1
import DocumentViewer.LibreOffice 1.0 as LibreOffice
-TextField {
+import "../common"
+
+TextFieldWithRightButton {
id: textField
anchors.verticalCenter: parent.verticalCenter
- width: units.gu(24)
-
- property var values: ["auto", 0.5, 0.7, 0.85, 1.0, 1.25, 1.5, 1.75, 2.0, 3.0, 4.0]
- property var labels: [
- i18n.tr("Automatic (Fit width)"),
- "50%", "70%", "85%", "100%", "125%",
- "150%", "175%","200%", "300%", "400%"
- ]
-
- property bool expanded: false
+ width: units.gu(12)
+
+ property var view: loPageContentLoader.item.loView
hasClearButton: true
inputMethodHints: Qt.ImhFormattedNumbersOnly
- validator: IntValidator{ bottom: 50; top: 400 }
+ validator: IntValidator { bottom: 50; top: 400 }
onAccepted: {
- loPageContentLoader.item.loView.zoomFactor = parseInt(text) / 100
+ view.setZoom(parseInt(text) / 100)
focus = false
}
- secondaryItem: AbstractButton {
- visible: !textField.highlighted
- id: listButton
- height: parent.height
- width: visible ? height : 0
-
- Rectangle {
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- height: parent.height - units.gu(1)
-
- width: units.dp(1)
- color: "Grey"
- opacity: 0.5
- }
-
- Icon {
- id: _upArrow
-
- width: units.gu(2)
- height: width
- anchors.centerIn: parent
-
- name: "go-down"
- color: "Grey"
- rotation: textField.expanded ? 180 : 0
-
- Behavior on rotation {
- UbuntuNumberAnimation {}
- }
- }
-
- onClicked: {
- textField.expanded = true
- PopupUtils.open(zoomSelectorDialog, listButton)
- }
- }
-
onHighlightedChanged: {
if (highlighted) {
- text = parseInt(loPageContentLoader.item.loView.zoomFactor * 100)
+ text = parseInt(view.zoomFactor * 100)
} else text = ""
}
Label {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: units.gu(2)
+ anchors.centerIn: parent
visible: !textField.highlighted
- text: loPageContentLoader.item.loView.zoomMode == LibreOffice.View.FitToWidth ? i18n.tr("Automatic (%1%)").arg(parseInt(loPageContentLoader.item.loView.zoomFactor*100))
- : i18n.tr("Zoom: %1%").arg(parseInt(loPageContentLoader.item.loView.zoomFactor*100))
- }
-
- Component {
- id: zoomSelectorDialog
- Popover {
- id: zoomSelectorDialogue
- autoClose: false
- contentHeight: units.gu(24)
- contentWidth: units.gu(24)
- Component.onDestruction: textField.expanded = false
-
- // We don't use 'autoClose' property, since we want to propagate
- // mouse/touch events to other items (e.g. when zoomSelectorDialogue
- // is visible, and user taps the zoom+ button on its right, we want
- // the zoom button to receive the event).
- InverseMouseArea {
- anchors.fill: parent
- propagateComposedEvents: true
-
- onPressed: {
- mouse.accepted = false
- PopupUtils.close(zoomSelectorDialogue)
- }
- }
-
- OptionSelector {
- expanded: true
- width: parent.width
- containerHeight: units.gu(24)
- model: textField.labels
- selectedIndex: {
- if (loPageContentLoader.item.loView.zoomMode == LibreOffice.View.FitToWidth)
- return 0
-
- for (var i=0; i<textField.values.length; i++) {
- if (values[i] == loView.zoomFactor)
- return i
- }
- return -1
- }
-
- onSelectedIndexChanged: {
- if (selectedIndex == 0) {
- loView.adjustZoomToWidth();
- return;
- }
-
- loPageContentLoader.item.loView.zoomFactor = textField.values[selectedIndex]
- PopupUtils.close(zoomSelectorDialogue)
- }
- }
- }
- }
-}
+ text: "%1%".arg(parseInt(view.zoomFactor*100))
+ }
+
+ popover: TextFieldButtonPopover {
+ id: zoomSelectorDialogue
+
+ RowLayout {
+ anchors { left: parent.left; right: parent.right }
+ height: units.gu(4)
+ spacing: units.gu(1)
+
+ ListItem {
+ divider.visible: false
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+
+ onClicked: {
+ var view = loPageContentLoader.item.loView
+ view.setZoom(view.zoomFactor + 0.1)
+ }
+
+ Icon {
+ width: units.gu(2); height: width
+ anchors.centerIn: parent
+ name: "zoom-in"
+ }
+ }
+
+ VerticalDivider {
+ Layout.fillHeight: true
+ Layout.preferredWidth: units.dp(2)
+ }
+
+ ListItem {
+ divider.visible: false
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+
+ onClicked: {
+ var view = loPageContentLoader.item.loView
+ view.setZoom(view.zoomFactor - 0.1)
+ }
+
+ Icon {
+ width: units.gu(2); height: width
+ anchors.centerIn: parent
+ name: "zoom-out"
+ }
+ }
+ } // RowLayout
+
+ HorizontalDivider { anchors { left: parent.left; right: parent.right } }
+
+ ListItem {
+ height: units.gu(4)
+ divider.visible: false
+
+ onClicked: {
+ view.adjustZoomToWidth()
+ zoomSelectorDialogue.close()
+ }
+
+ /* UITK 1.3 specs: Two slot layout (A-B) */
+ ListItemLayout {
+ anchors.centerIn: parent
+
+ /* UITK 1.3 specs: Slot A */
+ title.text: i18n.tr("Fit width")
+
+ /* UITK 1.3 specs: Slot B */
+ Icon {
+ SlotsLayout.position: SlotsLayout.Last
+ width: units.gu(2); height: width
+ name: "tick"
+ color: UbuntuColors.green
+ visible: view.zoomMode == LibreOffice.View.FitToWidth
+ }
+ }
+ } // ListItem
+
+ HorizontalDivider { anchors { left: parent.left; right: parent.right } }
+
+ Repeater {
+ model: [
+ { text: "50%", value: 0.50 },
+ { text: "70%", value: 0.70 },
+ { text: "85%", value: 0.85 },
+ { text: "100%", value: 1.00 },
+ { text: "125%", value: 1.25 },
+ { text: "150%", value: 1.50 },
+ { text: "175%", value: 1.75 },
+ { text: "200%", value: 2.00 },
+ { text: "300%", value: 3.00 },
+ { text: "400%", value: 4.00 }
+ ]
+
+ ListItem {
+ divider.visible: false
+ height: units.gu(4)
+
+ onClicked: {
+ view.setZoom(modelData.value)
+ zoomSelectorDialogue.close()
+ }
+
+ Label {
+ text: modelData.text
+ anchors {
+ left: parent.left; leftMargin: units.gu(1)
+ verticalCenter: parent.verticalCenter
+ }
+ }
+ }
+ } // Repeater
+ } // zoomSelectorDialogue
+} // textField
=== modified file 'src/app/qml/pdfView/PdfContentsPage.qml'
--- src/app/qml/pdfView/PdfContentsPage.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/pdfView/PdfContentsPage.qml 2015-11-13 21:19:59 +0000
@@ -16,11 +16,9 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
import QtQuick.Layouts 1.1
-import "../upstreamComponents"
-
Page {
id: pdfContents
objectName: "pdfcontents"
@@ -41,9 +39,6 @@
}
onActiveChanged: {
- // If the header was hidden in the PdfPage, make it visible.
- mainView.setHeaderVisibility(true);
-
// Find out the current page position in the ToC index
for (var i=0; i<poppler.tocModel.count; i++) {
if (i+1 < poppler.tocModel.count) {
@@ -111,7 +106,7 @@
font.weight: model.level == 0 ? Font.DemiBold : Font.Normal
color: (model.level == 0) ? UbuntuColors.midAubergine
- : Theme.palette.selected.backgroundText
+ : theme.palette.selected.backgroundText
}
/*
@@ -134,7 +129,7 @@
text: model.pageIndex + 1
font.weight: model.level == 0 ? Font.DemiBold : Font.Normal
color: (model.level == 0) ? UbuntuColors.midAubergine
- : Theme.palette.selected.backgroundText
+ : theme.palette.selected.backgroundText
}
}
}
=== modified file 'src/app/qml/pdfView/PdfView.qml'
--- src/app/qml/pdfView/PdfView.qml 2015-10-20 18:21:17 +0000
+++ src/app/qml/pdfView/PdfView.qml 2015-11-13 21:19:59 +0000
@@ -15,19 +15,19 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
import DocumentViewer.PDF 1.0 as PDF
+import "../common"
import "../common/utils.js" as Utils
-import "../upstreamComponents"
+
+// TODO: Use UITK 1.3 BottomEdge component when available
PageWithBottomEdge {
id: pdfPage
title: Utils.getNameOfFile(file.path);
- // Disable header auto-hide.
- // TODO: Show/hide header if a user taps the page
- flickable: null
+ flickable: pdfView
// TRANSLATORS: the first argument (%1) refers to the page currently shown on the screen,
// while the second one (%2) refers to the total pages count.
@@ -35,19 +35,37 @@
// TRANSLATORS: "Contents" refers to the "Table of Contents" of a PDF document.
bottomEdgeTitle: i18n.tr("Contents")
- bottomEdgePageComponent: PdfContentsPage {}
+ bottomEdgePageComponent: PdfContentsPage { }
bottomEdgeEnabled: poppler.tocModel.count > 0
// Reset night mode shader settings when closing the page
// Component.onDestruction: mainView.nightModeEnabled = false
+ Rectangle {
+ // Since UITK 1.3, the MainView background is white.
+ // We need to set a different color, otherwise pages
+ // boundaries are not visible.
+ anchors.fill: parent
+ color: "#f5f5f5"
+ }
+
PDF.VerticalView {
id: pdfView
objectName: "pdfView"
- anchors.fill: parent
+
+ anchors {
+ fill: parent
+
+ // WORKAROUND: If we set 'pdfPage.flickable' property, 'pdfView' is not
+ // longer aligned to the bottom of the header, but to the top instead.
+ // This is deprecated code though, and it's not worth to spend more time
+ // for a proper fix here.
+ // (This is likely a bug in the VerticalView class.)
+ topMargin: units.gu(6)
+ }
+
spacing: units.gu(2)
- clip: true
boundsBehavior: Flickable.StopAtBounds
flickDeceleration: 1500 * units.gridUnit / 8
maximumFlickVelocity: 2500 * units.gridUnit / 8
@@ -92,6 +110,7 @@
Item { id: _zoomHelper }
}
+
Scrollbar { flickableItem: pdfView }
Scrollbar { flickableItem: pdfView; align: Qt.AlignBottom }
@@ -107,9 +126,6 @@
var title = getDocumentInfo("Title")
if (title !== "")
pdfPage.title = title;
-
- // Hide header when the document is ready
- mainView.setHeaderVisibility(false);
}
}
=== modified file 'src/app/qml/pdfView/PdfViewDefaultHeader.qml'
--- src/app/qml/pdfView/PdfViewDefaultHeader.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/pdfView/PdfViewDefaultHeader.qml 2015-11-13 21:19:59 +0000
@@ -15,9 +15,10 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
import QtQuick.Layouts 1.1
-import Ubuntu.Components.Popups 1.0
+import Ubuntu.Components.Popups 1.3
+import DocumentViewer 1.0
PageHeadState {
id: rootItem
@@ -31,7 +32,7 @@
anchors.fill: parent
spacing: units.gu(1)
- ActivityIndicator { id: activity }
+ ActivityIndicator { id: activity; visible: running }
Column {
id: layout
@@ -50,27 +51,12 @@
//horizontalAlignment: Text.AlignHCenter
elide: Text.ElideMiddle
- fontSize: "small"
+ textSize: Label.Small
text: targetPage.currentPage
}
}
}
- backAction: Action {
- iconName: "back"
- text: (pageStack.depth > 1) ? i18n.tr("Back") : i18n.tr("Close")
- onTriggered: {
- if (pageStack.depth > 1) {
- // Go back to Welcome page
- pageStack.pop();
- } else {
- // File has been imported through Content Hub (or was not chosen through WelcomePage)
- // Close the application and show our source app (e.g. ubuntu-filemanager-app, if used to open a document)
- Qt.quit()
- }
- }
- }
-
actions: [
Action {
iconName: "search"
=== modified file 'src/app/qml/pdfView/PdfViewDelegate.qml'
--- src/app/qml/pdfView/PdfViewDelegate.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/pdfView/PdfViewDelegate.qml 2015-11-13 21:19:59 +0000
@@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
Rectangle {
id: pdfPage
=== modified file 'src/app/qml/pdfView/PdfViewGotoDialog.qml'
--- src/app/qml/pdfView/PdfViewGotoDialog.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/pdfView/PdfViewGotoDialog.qml 2015-11-13 21:19:59 +0000
@@ -15,8 +15,8 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.Popups 1.0
+import Ubuntu.Components 1.3
+import Ubuntu.Components.Popups 1.3
import QtQuick.Layouts 1.1
Dialog {
=== modified file 'src/app/qml/textView/TextView.qml'
--- src/app/qml/textView/TextView.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/textView/TextView.qml 2015-11-13 21:19:59 +0000
@@ -15,14 +15,14 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.Themes.Ambiance 1.2
+import Ubuntu.Components 1.3
+import Ubuntu.Components.Themes.Ambiance 1.3
import "../common/utils.js" as Utils
Page {
id: textPage
- title: Utils.getNameOfFile(file.path);
+ title: Utils.getNameOfFile(file.path) + "-" + file.mimetype.description
// Reset night mode shader settings when closing the page
// Component.onDestruction: mainView.nightModeEnabled = false
=== modified file 'src/app/qml/textView/TextViewDefaultHeader.qml'
--- src/app/qml/textView/TextViewDefaultHeader.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/textView/TextViewDefaultHeader.qml 2015-11-13 21:19:59 +0000
@@ -15,9 +15,10 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
+import Ubuntu.Components 1.3
import QtQuick.Layouts 1.1
-import Ubuntu.Components.Popups 1.0
+import Ubuntu.Components.Popups 1.3
+import DocumentViewer 1.0
PageHeadState {
id: rootItem
@@ -31,7 +32,7 @@
anchors.fill: parent
spacing: units.gu(1)
- ActivityIndicator { id: activity }
+ ActivityIndicator { id: activity; visible: running }
Column {
id: layout
@@ -50,27 +51,12 @@
//horizontalAlignment: Text.AlignHCenter
elide: Text.ElideMiddle
- fontSize: "small"
+ textSize: Label.Small
text: file.mimetype.description
}
}
}
- backAction: Action {
- iconName: "back"
- text: (pageStack.depth > 1) ? i18n.tr("Back") : i18n.tr("Close")
- onTriggered: {
- if (pageStack.depth > 1) {
- // Go back to Welcome page
- pageStack.pop();
- } else {
- // File has been imported through Content Hub (or was not chosen through WelcomePage)
- // Close the application and show our source app (e.g. ubuntu-filemanager-app, if used to open a document)
- Qt.quit()
- }
- }
- }
-
actions: [
Action {
iconName: "night-mode"
=== modified file 'src/app/qml/ubuntu-docviewer-app.qml'
--- src/app/qml/ubuntu-docviewer-app.qml 2015-10-20 18:21:17 +0000
+++ src/app/qml/ubuntu-docviewer-app.qml 2015-11-13 21:19:59 +0000
@@ -15,8 +15,8 @@
*/
import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.Popups 1.0
+import Ubuntu.Components 1.3
+import Ubuntu.Components.Popups 1.3
import DocumentViewer 1.0
import QtQuick.Window 2.0
import Qt.labs.settings 1.0
@@ -66,40 +66,25 @@
mainView, { parent: mainView });
}
- function toggleFullScreen() {
- mainView.fullscreen = !mainView.fullscreen
- }
-
- function setHeaderVisibility(visible, toggleFullscreen) {
- toggleFullscreen = typeof toggleFullscreen !== 'undefined' ? toggleFullscreen : true
- header.visible = visible;
-
+ function switchToBrowseMode() {
+ mainView.pickMode = false
+ }
+
+ function switchToPickMode() {
+ 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;
+ mainView.fullscreen = true
return;
+ } else {
+ mainView.fullscreen = false
}
-
- if (!DocumentViewer.desktopMode && toggleFullscreen)
- mainView.fullscreen = !visible;
- }
-
- function toggleHeaderVisibility() {
- setHeaderVisibility(!header.visible);
- }
-
- function switchToBrowseMode() {
- mainView.pickMode = false
- }
-
- function switchToPickMode() {
- mainView.pickMode = true
- }
-
- // On screen rotation, force updating of header/U8 indicators panel visibility
- onIsLandscapeChanged: setHeaderVisibility(true);
+ }
onFullscreenChanged: {
if (mainView.fullscreen)
=== removed directory 'src/app/qml/upstreamComponents'
=== modified file 'src/plugin/libreofficetoolkit-qml-plugin/qml/Viewer.qml'
--- src/plugin/libreofficetoolkit-qml-plugin/qml/Viewer.qml 2015-10-05 06:42:33 +0000
+++ src/plugin/libreofficetoolkit-qml-plugin/qml/Viewer.qml 2015-11-13 21:19:59 +0000
@@ -20,17 +20,30 @@
Flickable {
id: rootFlickable
- property alias document: view.document
- property alias zoomFactor: view.zoomFactor
- property alias cacheBuffer: view.cacheBuffer
- property alias partsModel: view.partsModel
- property alias zoomMode: view.zoomMode
-
- property string documentPath: ""
+ property alias document: view.document
+ property alias zoomFactor: view.zoomFactor
+ property alias cacheBuffer: view.cacheBuffer
+ property alias zoomMode: view.zoomMode
+ property alias partsModel: view.partsModel
+ property string documentPath: ""
function adjustZoomToWidth()
{
- view.adjustZoomToWidth();
+ var oldZoom = view.zoomFactor
+ view.adjustZoomToWidth()
+
+ var zoomScale = view.zoomFactor / oldZoom
+ rootFlickable.contentX *= zoomScale
+ rootFlickable.contentY *= zoomScale
+ }
+
+ function setZoom(newValue)
+ {
+ var zoomScale = newValue / view.zoomFactor;
+ view.zoomFactor = newValue;
+
+ rootFlickable.contentX *= zoomScale;
+ rootFlickable.contentY *= zoomScale;
}
function moveView(axis, diff)
Follow ups