summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Martin <notmart@gmail.com>2015-12-22 18:51:34 (GMT)
committerMarco Martin <notmart@gmail.com>2015-12-22 18:52:55 (GMT)
commit9689a8eccd39469fa6c7ecd37b7ea12f8498f6e6 (patch)
tree92870882ab7a3b332ef40588d782d82163f792a7
parent355d592bfb6a817ce537f1b39a82ba7b0c4e99ca (diff)
add missing file
-rw-r--r--mobile/app/package/contents/ui/OkularDrawer.qml133
1 files changed, 133 insertions, 0 deletions
diff --git a/mobile/app/package/contents/ui/OkularDrawer.qml b/mobile/app/package/contents/ui/OkularDrawer.qml
new file mode 100644
index 0000000..9df7f62
--- /dev/null
+++ b/mobile/app/package/contents/ui/OkularDrawer.qml
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2012 Marco Martin <mart@kde.org>
+ *
+ * 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; either version 2,
+ * or (at your option) any later version.
+ *
+ * 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, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.kde.plasma.extras 2.0 as PlasmaExtras
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
+import org.kde.kquickcontrolsaddons 2.0
+import org.kde.okular 2.0 as Okular
+
+
+MobileComponents.OverlayDrawer {
+ edge: Qt.RightEdge
+ contentItem: Item {
+ id: browserFrame
+ anchors.fill: parent
+ state: "Hidden"
+
+ PlasmaComponents.ToolBar {
+ id: mainToolBar
+
+ height: units.gridUnit * 2
+ y: pageStack.currentPage.contentY <= 0 ? 0 : -height
+ transform: Translate {
+ y: Math.max(0, -pageStack.currentPage.contentY)
+ }
+ tools: pageStack.currentPage.tools
+ Behavior on y {
+ NumberAnimation {
+ duration: 250
+ }
+ }
+ anchors {
+ left: parent.left
+ right: parent.right
+ }
+ }
+
+
+ PlasmaComponents.PageStack {
+ id: pageStack
+ anchors {
+ left: parent.left
+ top: mainToolBar.bottom
+ right: parent.right
+ bottom: tabsToolbar.top
+ }
+ clip: true
+ toolBar: mainToolBar
+ }
+
+ Connections {
+ id: scrollConnection
+ property int oldContentY:0
+ target: pageStack.currentPage
+
+ onContentYChanged: {
+ scrollConnection.oldContentY = pageStack.currentPage.contentY
+ }
+ }
+
+ PlasmaComponents.ToolBar {
+ id: tabsToolbar
+ y: parent.height - tabsToolbar.height*5
+ height: mainTabBar.height
+ anchors {
+ top: undefined
+ bottom: browserFrame.bottom
+ left: parent.left
+ right: parent.right
+ }
+ tools: Item {
+ width: parent.width
+ height: childrenRect.height
+ PlasmaComponents.TabBar {
+ id: mainTabBar
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: Math.min(parent.width, implicitWidth)
+ tabPosition: Qt.BottomEdge
+ PlasmaComponents.TabButton {
+ id: thumbnailsButton
+ text: tabsToolbar.width > units.gridUnit * 30 ? i18n("Thumbnails") : ""
+ iconSource: "view-preview"
+ onCheckedChanged: {
+ if (checked) {
+ pageStack.replace(Qt.createComponent("Thumbnails.qml"))
+ }
+ }
+ }
+ PlasmaComponents.TabButton {
+ id: tocButton
+ enabled: documentItem.tableOfContents.count > 0
+ text: tabsToolbar.width > units.gridUnit * 30 ? i18n("Table of contents") : ""
+ iconSource: "view-table-of-contents-ltr"
+ onCheckedChanged: {
+ if (checked) {
+ pageStack.replace(Qt.createComponent("TableOfContents.qml"))
+ }
+ }
+ }
+ PlasmaComponents.TabButton {
+ id: bookmarksButton
+ enabled: documentItem.bookmarkedPages.length > 0
+ text: tabsToolbar.width > units.gridUnit * 30 ? i18n("Bookmarks") : ""
+ iconSource: "bookmarks-organize"
+ onCheckedChanged: {
+ if (checked) {
+ pageStack.replace(Qt.createComponent("Bookmarks.qml"))
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}