diff --git a/mobile/app/package/contents/ui/Browser.qml b/mobile/app/package/contents/ui/Browser.qml deleted file mode 100644 index 873a1c0fa..000000000 --- a/mobile/app/package/contents/ui/Browser.qml +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2012 Marco Martin - * - * 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.SplitDrawer { - id: splitDrawer - anchors.fill: parent - visible: true - - property alias splitDrawerOpen: splitDrawer.opened - property alias overlayDrawerOpen: resourceBrowser.opened - property Item globalDrawer: splitDrawer - property Item contextDrawer: resourceDrawer - - //An alias doesn't work - property bool bookmarked: false - onBookmarkedChanged: { - pageArea.page.bookmarked = bookmarked - } - - contentItem: Documents { - implicitWidth: units.gridUnit * 25 - } - - MobileComponents.OverlayDrawer { - id: resourceBrowser - anchors.fill: parent - edge: Qt.RightEdge - - Okular.DocumentView { - id: pageArea - document: documentItem - anchors.fill: parent - - onPageChanged: { - bookmarkConnection.target = page - splitDrawer.bookmarked = page.bookmarked - } - } - //HACK - Connections { - id: bookmarkConnection - target: pageArea.page - onBookmarkedChanged: splitDrawer.bookmarked = pageArea.page.bookmarked - } - - 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")) - } - } - } - } - } - } - } - } -} diff --git a/mobile/app/package/contents/ui/Documents.qml b/mobile/app/package/contents/ui/Documents.qml index d6002e875..f0e4279b2 100644 --- a/mobile/app/package/contents/ui/Documents.qml +++ b/mobile/app/package/contents/ui/Documents.qml @@ -1,100 +1,88 @@ /* * Copyright 2015 Marco Martin * * 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 QtQuick.Controls 1.3 +import org.kde.kirigami 1.0 as Kirigami import Qt.labs.folderlistmodel 2.1 -MobileComponents.Page { +Item { id: root anchors.fill: parent - color: theme.viewBackgroundColor - visible: true + property Item view: filesView property alias contentY: filesView.contentY property alias contentHeight: filesView.contentHeight property alias model: filesView.model - tools: Item { + Item { id: toolBarContent width: root.width - height: searchField.height - PlasmaComponents.TextField { + height: searchField.height + Kirigami.Units.gridUnit + TextField { id: searchField anchors.centerIn: parent - onTextChanged: { - if (text.length > 2) { - filterModel.filterRegExp = ".*" + text + ".*"; - } else { - filterModel.filterRegExp = ""; - } - } + focus: true } } - MobileComponents.Label { + Kirigami.Label { z: 2 visible: filesView.count == 0 anchors { fill: parent - margins: MobileComponents.Units.gridUnit + margins: Kirigami.Units.gridUnit } text: i18n("No Documents found. To start to read, put some files in the Documents folder of your device.") wrapMode: Text.WordWrap horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } - PlasmaExtras.ScrollArea { - anchors.fill: parent + ScrollView { + anchors { + top: toolBarContent.bottom + left: parent.left + right: parent.right + bottom: parent.bottom + } ListView { id: filesView anchors.fill: parent - model: PlasmaCore.SortFilterModel { - id: filterModel - filterRole: "fileName" - sourceModel: FolderListModel { - id: folderModel - folder: userPaths.documents - nameFilters: ["*.pdf", "*.txt", "*.chm", "*.epub"] - showDirs: false - } + model: FolderListModel { + id: folderModel + folder: userPaths.documents + nameFilters: ["*.pdf", "*.txt", "*.chm", "*.epub"] + showDirs: false } - delegate: MobileComponents.ListItem { - enabled: true - PlasmaComponents.Label { - text: model.fileName - horizontalAlignment: Text.AlignHCenter - wrapMode: Text.WordWrap - elide: Text.ElideRight - } + delegate: Kirigami.BasicListItem { + label: model.fileName + visible: model.fileName.indexOf(searchField.text) !== -1 + height: visible ? implicitHeight : 0 onClicked: { documentItem.path = model.filePath; globalDrawer.opened = false; mainTabBar.currentTab = thumbnailsButton; } } } } } diff --git a/mobile/app/package/contents/ui/MainView.qml b/mobile/app/package/contents/ui/MainView.qml new file mode 100644 index 000000000..ec791af53 --- /dev/null +++ b/mobile/app/package/contents/ui/MainView.qml @@ -0,0 +1,53 @@ +/* + * Copyright 2012 Marco Martin + * + * 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.okular 2.0 as Okular +import org.kde.kirigami 1.0 as Kirigami + +Kirigami.Page { + property alias document: pageArea.document + leftPadding: 0 + topPadding: 0 + rightPadding: 0 + bottomPadding: 0 + + actions.main: Kirigami.Action { + iconName: "bookmarks-organize" + checkable: true + onCheckedChanged: pageArea.page.bookmarked = checked; + } + + Okular.DocumentView { + id: pageArea + anchors.fill: parent + + onPageChanged: { + bookmarkConnection.target = page + actions.main.checked = page.bookmarked + } + onClicked: fileBrowserRoot.controlsVisible = !fileBrowserRoot.controlsVisible + } + + Connections { + id: bookmarkConnection + target: pageArea.page + onBookmarkedChanged: actions.main.checked = pageArea.page.bookmarked + } +} diff --git a/mobile/app/package/contents/ui/OkularDrawer.qml b/mobile/app/package/contents/ui/OkularDrawer.qml index 2fbbd302b..bb2a206a9 100644 --- a/mobile/app/package/contents/ui/OkularDrawer.qml +++ b/mobile/app/package/contents/ui/OkularDrawer.qml @@ -1,134 +1,116 @@ /* * Copyright 2012 Marco Martin * * 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 QtQuick.Controls 1.3 +import org.kde.kirigami 1.0 as Kirigami import org.kde.kquickcontrolsaddons 2.0 import org.kde.okular 2.0 as Okular -MobileComponents.OverlayDrawer { +Kirigami.OverlayDrawer { edge: Qt.RightEdge contentItem: Item { id: browserFrame - implicitWidth: MobileComponents.Units.gridUnit * 25 + implicitWidth: Kirigami.Units.gridUnit * 25 implicitHeight: implicitWidth 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 { + StackView { id: pageStack anchors { left: parent.left - top: mainToolBar.bottom + top: parent.top right: parent.right bottom: tabsToolbar.top } clip: true - toolBar: mainToolBar } Connections { id: scrollConnection property int oldContentY:0 - target: pageStack.currentPage + target: pageStack.currentItem onContentYChanged: { - scrollConnection.oldContentY = pageStack.currentPage.contentY + scrollConnection.oldContentY = pageStack.currentItem.contentY } } - PlasmaComponents.ToolBar { + 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 { + Component.onCompleted: thumbnailsButton.checked = true; + Item { width: parent.width height: childrenRect.height - PlasmaComponents.TabBar { + Row { id: mainTabBar anchors.horizontalCenter: parent.horizontalCenter width: Math.min(parent.width, implicitWidth) - tabPosition: Qt.BottomEdge - PlasmaComponents.TabButton { + ExclusiveGroup { id: tabPositionGroup } + ToolButton { id: thumbnailsButton text: tabsToolbar.width > units.gridUnit * 30 ? i18n("Thumbnails") : "" - iconSource: "view-preview" + iconName: "view-preview" + checkable: true onCheckedChanged: { if (checked) { pageStack.replace(Qt.createComponent("Thumbnails.qml")) } } + exclusiveGroup: tabPositionGroup } - PlasmaComponents.TabButton { + ToolButton { id: tocButton enabled: documentItem.tableOfContents.count > 0 text: tabsToolbar.width > units.gridUnit * 30 ? i18n("Table of contents") : "" - iconSource: "view-table-of-contents-ltr" + iconName: "view-table-of-contents-ltr" + checkable: true onCheckedChanged: { if (checked) { pageStack.replace(Qt.createComponent("TableOfContents.qml")) } } + exclusiveGroup: tabPositionGroup } - PlasmaComponents.TabButton { + ToolButton { id: bookmarksButton enabled: documentItem.bookmarkedPages.length > 0 text: tabsToolbar.width > units.gridUnit * 30 ? i18n("Bookmarks") : "" - iconSource: "bookmarks-organize" + iconName: "bookmarks-organize" + checkable: true onCheckedChanged: { if (checked) { pageStack.replace(Qt.createComponent("Bookmarks.qml")) } } + exclusiveGroup: tabPositionGroup } } } } } } diff --git a/mobile/app/package/contents/ui/TableOfContents.qml b/mobile/app/package/contents/ui/TableOfContents.qml index b5a9bc949..7b5a5ad8c 100644 --- a/mobile/app/package/contents/ui/TableOfContents.qml +++ b/mobile/app/package/contents/ui/TableOfContents.qml @@ -1,65 +1,71 @@ /* * Copyright 2012 Marco Martin * * 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.core 2.0 as PlasmaCore -import org.kde.plasma.extras 2.0 as PlasmaExtras -import org.kde.plasma.mobilecomponents 0.2 as MobileComponents +import QtQuick.Controls 1.3 +import org.kde.kirigami 1.0 as Kirigami -PlasmaComponents.Page { +Kirigami.Page { id: root + leftPadding: 0 + topPadding: 0 + rightPadding: 0 + bottomPadding: 0 property alias contentY: flickable.contentY property alias contentHeight: flickable.contentHeight - tools: Item { + ToolBar { id: toolBarContent width: root.width height: searchField.height - PlasmaComponents.TextField { + TextField { id: searchField - clearButtonShown: true anchors.centerIn: parent } } - PlasmaExtras.ScrollArea { - anchors.fill: parent + ScrollView { + anchors { + left: parent.left + top: toolBarContent.bottom + right: parent.right + bottom: parent.bottom + } Flickable { id: flickable anchors.fill: parent contentWidth: width contentHeight: treeView.height Column { id: treeView width: flickable.width Repeater { model: VisualDataModel { id: tocModel model: documentItem.tableOfContents delegate: TreeDelegate { sourceModel: tocModel width: treeView.width } } } } } } } diff --git a/mobile/app/package/contents/ui/Thumbnails.qml b/mobile/app/package/contents/ui/Thumbnails.qml index c3a4f8417..ab443ef0b 100644 --- a/mobile/app/package/contents/ui/Thumbnails.qml +++ b/mobile/app/package/contents/ui/Thumbnails.qml @@ -1,57 +1,55 @@ /* * Copyright 2012 Marco Martin * * 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.core 2.0 as PlasmaCore -import org.kde.plasma.mobilecomponents 0.2 as MobileComponents +import QtQuick.Controls 1.3 +import org.kde.kirigami 1.0 as Kirigami ThumbnailsBase { id: root model: documentItem.matchingPages anchors.fill: parent - tools: Item { + ToolBar { id: toolBarContent width: root.width height: searchField.height - PlasmaComponents.TextField { + TextField { id: searchField - clearButtonShown: true enabled: documentItem.supportsSearch anchors.centerIn: parent onTextChanged: { if (text.length > 2) { documentItem.searchText(text); } else { view.currentIndex = pageArea.delegate.pageNumber; documentItem.resetSearch(); } } } - PlasmaComponents.Label { + Kirigami.Label { anchors { left: searchField.right verticalCenter: searchField.verticalCenter } visible: documentItem.matchingPages.length == 0 text: i18n("No results found.") } } } diff --git a/mobile/app/package/contents/ui/ThumbnailsBase.qml b/mobile/app/package/contents/ui/ThumbnailsBase.qml index c4345a7d2..c276e3f63 100644 --- a/mobile/app/package/contents/ui/ThumbnailsBase.qml +++ b/mobile/app/package/contents/ui/ThumbnailsBase.qml @@ -1,103 +1,109 @@ /* * Copyright 2012 Marco Martin * * 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 QtQuick.Controls 1.3 import org.kde.okular 2.0 as Okular -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.extras 2.0 as PlasmaExtras -import org.kde.plasma.mobilecomponents 0.2 as MobileComponents +import org.kde.kirigami 1.0 as Kirigami -PlasmaComponents.Page { +Kirigami.Page { id: root + leftPadding: 0 + topPadding: 0 + rightPadding: 0 + bottomPadding: 0 property alias contentY: resultsGrid.contentY property alias contentHeight: resultsGrid.contentHeight property alias model: resultsGrid.model signal pageClicked(int pageNumber) property Item view: resultsGrid anchors.fill: parent - PlasmaExtras.ScrollArea { - anchors.fill: parent + ScrollView { + anchors { + fill: parent + topMargin: Kirigami.Units.gridUnit * 2 + } GridView { id: resultsGrid anchors.fill: parent cellWidth: width / Math.floor(width / (units.gridUnit * 5)) cellHeight: cellWidth * 1.6 delegate: Item { id: delegate width: resultsGrid.cellWidth height: resultsGrid.cellHeight property bool current: documentItem.currentPage == modelData onCurrentChanged: { if (current) { resultsGrid.currentIndex = index } } - PlasmaCore.FrameSvgItem { + Rectangle { anchors.centerIn: parent - imagePath: "widgets/media-delegate" - prefix: "picture" - width: thumbnail.width + margins.left + margins.right + width: thumbnail.width + Kirigami.Units.smallSpacing * 2 //FIXME: why bindings with thumbnail.height doesn't work? - height: thumbnail.height + margins.top + margins.bottom + height: thumbnail.height + Kirigami.Units.smallSpacing * 2 Okular.ThumbnailItem { id: thumbnail - x: parent.margins.left - y: parent.margins.top + x: Kirigami.Units.smallSpacing + y: Kirigami.Units.smallSpacing document: documentItem pageNumber: modelData - width: delegate.width - parent.margins.left + parent.margins.right - units.gridUnit + width: delegate.width - Kirigami.Units.smallSpacing * 2 - units.gridUnit //value repeated to avoid binding loops height: Math.round(width / (implicitWidth/implicitHeight)) Rectangle { width: childrenRect.width height: childrenRect.height color: theme.backgroundColor radius: width smooth: true anchors { bottom: parent.bottom right: parent.right } - PlasmaComponents.Label { + Kirigami.Label { text: modelData + 1 } } } MouseArea { anchors.fill: parent onClicked: { resultsGrid.currentIndex = index documentItem.currentPage = modelData contextDrawer.opened = false root.pageClicked(modelData) } } } } - highlight: PlasmaComponents.Highlight {} + highlight: Rectangle { + color: Kirigami.Theme.highlightColor + opacity: 0.4 + } } } } diff --git a/mobile/app/package/contents/ui/TreeDelegate.qml b/mobile/app/package/contents/ui/TreeDelegate.qml index 966410ffc..fe77c8f71 100644 --- a/mobile/app/package/contents/ui/TreeDelegate.qml +++ b/mobile/app/package/contents/ui/TreeDelegate.qml @@ -1,109 +1,108 @@ /* * Copyright 2012 Marco Martin * * 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.core 2.0 as PlasmaCore import org.kde.kquickcontrolsaddons 2.0 +import org.kde.kirigami 1.0 as Kirigami Column { id: treeDelegate property variant sourceModel property int rowIndex: index width: parent.width property bool matches: display.toLowerCase().indexOf(searchField.text.toLowerCase()) !== -1 MouseArea { id: delegateArea width: parent.width height: matches ? label.height : 0 opacity: matches ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 250 } } onClicked: { documentItem.currentPage = page-1 contextDrawer.opened = false } QIconItem { id: icon icon: decoration width: theme.smallIconSize height: width anchors.verticalCenter: parent.verticalCenter x: units.largeSpacing } - PlasmaComponents.Label { + Kirigami.Label { id: label text: display verticalAlignment: Text.AlignBottom anchors.left: icon.right } //there isn't a sane way to do a dotted line in QML Rectangle { color: theme.textColor opacity: 0.3 height: 1 anchors { bottom: parent.bottom left: label.right right: pageNumber.left } } - PlasmaComponents.Label { + Kirigami.Label { id: pageNumber text: pageLabel ? pageLabel : page anchors.right: parent.right verticalAlignment: Text.AlignBottom anchors.rightMargin: units.largeSpacing } } Column { id: col x: 20 width: parent.width - 20 property variant model: childrenModel Repeater { id: rep model: VisualDataModel { id: childrenModel model: documentItem.tableOfContents } } } onParentChanged: { if (treeDelegate.parent && treeDelegate.parent.model) { sourceModel = treeDelegate.parent.model } childrenModel.rootIndex = sourceModel.modelIndex(index) if (model.hasModelChildren) { childrenModel.delegate = Qt.createComponent("TreeDelegate.qml") } } } diff --git a/mobile/app/package/contents/ui/main.qml b/mobile/app/package/contents/ui/main.qml index b91ad71c1..09410c802 100644 --- a/mobile/app/package/contents/ui/main.qml +++ b/mobile/app/package/contents/ui/main.qml @@ -1,98 +1,84 @@ /* * Copyright 2012 Marco Martin * * 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.okular 2.0 as Okular import QtQuick.Controls 1.3 -import org.kde.plasma.extras 2.0 as PlasmaExtras -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.mobilecomponents 0.2 as MobileComponents +import org.kde.okular 2.0 as Okular +import org.kde.kirigami 1.0 as Kirigami -MobileComponents.ApplicationWindow { +Kirigami.AbstractApplicationWindow { id: fileBrowserRoot objectName: "fileBrowserRoot" visible: true /*TODO: port ResourceInstance PlasmaExtras.ResourceInstance { id: resourceInstance uri: documentItem.path }*/ - globalDrawer: MobileComponents.OverlayDrawer { + header: null + globalDrawer: Kirigami.OverlayDrawer { edge: Qt.LeftEdge contentItem: Documents { implicitWidth: units.gridUnit * 20 } } contextDrawer: OkularDrawer {} - actionButton.iconSource: "bookmarks-organize" - actionButton.checkable: true - actionButton.onCheckedChanged: pageArea.page.bookmarked = actionButton.checked; - PlasmaComponents.ProgressBar { + + ProgressBar { id: bar z: 99 anchors { left: parent.left right: parent.right bottom: parent.bottom } height: units.smallSpacing value: documentItem.pageCount != 0 ? (documentItem.currentPage / documentItem.pageCount) : 0 } Okular.DocumentItem { id: documentItem onWindowTitleForDocumentChanged: { fileBrowserRoot.title = windowTitleForDocument } } - Okular.DocumentView { + MainView { id: pageArea - document: documentItem anchors.fill: parent - - onPageChanged: { - bookmarkConnection.target = page - actionButton.checked = page.bookmarked - } - onClicked: actionButton.toggleVisibility(); - } - Connections { - id: bookmarkConnection - target: pageArea.page - onBookmarkedChanged: actionButton.checked = page.bookmarked + document: documentItem } //FIXME: this is due to global vars being binded after the parse is done, do the 2 steps parsing Timer { interval: 100 running: true onTriggered: { if (commandlineArguments.length > 0) { documentItem.path = commandlineArguments[0] } if (commandlineArguments.length == 0) { globalDrawer.opened = true; } } } }