Verified Commit c1b396af authored by Jonah Brüchert's avatar Jonah Brüchert 🌳

mobile: fully port to QQC2

Summary: Remove all QtQuick Controls 1 imports and replace by QtQuick Controls 2

Test Plan: The mobile app behaves just as before

Reviewers: #okular, ngraham

Reviewed By: ngraham

Subscribers: ngraham, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D21675
parent 3311ba3a
......@@ -18,7 +18,7 @@
*/
import QtQuick 2.1
import QtQuick.Controls 1.3
import QtQuick.Controls 2.3 as QQC2
import org.kde.okular 2.0 as Okular
import org.kde.kirigami 2.0 as Kirigami
......@@ -51,7 +51,7 @@ Kirigami.Page {
target: pageArea.page
onBookmarkedChanged: actions.main.checked = pageArea.page.bookmarked
}
ProgressBar {
QQC2.ProgressBar {
id: bar
z: 99
visible: applicationWindow().controlsVisible
......
......@@ -18,7 +18,7 @@
*/
import QtQuick 2.1
import QtQuick.Controls 2.5
import QtQuick.Controls 2.5 as QQC2
import org.kde.kirigami 2.0 as Kirigami
import org.kde.okular 2.0 as Okular
......@@ -31,7 +31,7 @@ Kirigami.OverlayDrawer {
implicitHeight: implicitWidth
state: "Hidden"
StackView {
QQC2.StackView {
id: pageStack
anchors {
left: parent.left
......@@ -47,7 +47,7 @@ Kirigami.OverlayDrawer {
onUrlChanged: thumbnailsButton.checked = true;
}
ToolBar {
QQC2.ToolBar {
id: tabsToolbar
height: mainTabBar.height
anchors {
......@@ -65,8 +65,8 @@ Kirigami.OverlayDrawer {
spacing: 0
anchors.horizontalCenter: parent.horizontalCenter
width: Math.min(parent.width, implicitWidth)
ButtonGroup { id: tabPositionGroup }
ToolButton {
QQC2.ButtonGroup { id: tabPositionGroup }
QQC2.ToolButton {
id: thumbnailsButton
text: tabsToolbar.width > Kirigami.Units.gridUnit * 30 ? i18n("Thumbnails") : ""
icon.name: "view-preview"
......@@ -77,9 +77,9 @@ Kirigami.OverlayDrawer {
pageStack.replace(Qt.createComponent("Thumbnails.qml"))
}
}
ButtonGroup.group: tabPositionGroup
QQC2.ButtonGroup.group: tabPositionGroup
}
ToolButton {
QQC2.ToolButton {
id: tocButton
enabled: documentItem.tableOfContents.count > 0
text: tabsToolbar.width > Kirigami.Units.gridUnit * 30 ? i18n("Table of contents") : ""
......@@ -91,9 +91,9 @@ Kirigami.OverlayDrawer {
pageStack.replace(Qt.createComponent("TableOfContents.qml"))
}
}
ButtonGroup.group: tabPositionGroup
QQC2.ButtonGroup.group: tabPositionGroup
}
ToolButton {
QQC2.ToolButton {
id: bookmarksButton
enabled: documentItem.bookmarkedPages.length > 0
text: tabsToolbar.width > Kirigami.Units.gridUnit * 30 ? i18n("Bookmarks") : ""
......@@ -105,7 +105,7 @@ Kirigami.OverlayDrawer {
pageStack.replace(Qt.createComponent("Bookmarks.qml"))
}
}
ButtonGroup.group: tabPositionGroup
QQC2.ButtonGroup.group: tabPositionGroup
}
}
}
......
......@@ -18,7 +18,6 @@
*/
import QtQuick 2.1
import QtQuick.Controls 1.3
import QtQuick.Controls 2.0 as QQC2
import org.kde.kirigami 2.0 as Kirigami
......@@ -35,12 +34,12 @@ Kirigami.Page {
id: toolBarContent
width: root.width
height: searchField.height
QQC2.TextField {
TextField {
id: searchField
anchors.centerIn: parent
}
}
ScrollView {
QQC2.ScrollView {
anchors {
left: parent.left
top: toolBarContent.bottom
......
......@@ -18,18 +18,18 @@
*/
import QtQuick 2.1
import QtQuick.Controls 2.0
import QtQuick.Controls 2.0 as QQC2
import org.kde.kirigami 2.0 as Kirigami
ThumbnailsBase {
id: root
model: documentItem.matchingPages
ToolBar {
QQC2.ToolBar {
id: toolBarContent
width: root.width
height: searchField.height
TextField {
QQC2.TextField {
id: searchField
anchors.fill: parent
enabled: documentItem ? documentItem.supportsSearching : false
......
......@@ -18,7 +18,7 @@
*/
import QtQuick 2.1
import QtQuick.Controls 1.3
import QtQuick.Controls 2.3 as QQC2
import QtGraphicalEffects 1.0
import org.kde.okular 2.0 as Okular
import org.kde.kirigami 2.0 as Kirigami
......@@ -35,13 +35,13 @@ Kirigami.Page {
signal pageClicked(int pageNumber)
property Item view: resultsGrid
ScrollView {
QQC2.ScrollView {
anchors {
fill: parent
topMargin: Kirigami.Units.gridUnit * 2
}
Label {
QQC2.Label {
anchors.centerIn: parent
visible: model.length == 0
text: i18n("No results found.")
......@@ -88,7 +88,7 @@ Kirigami.Page {
bottom: parent.bottom
right: parent.right
}
Label {
QQC2.Label {
text: modelData + 1
}
}
......
......@@ -18,7 +18,7 @@
*/
import QtQuick 2.1
import QtQuick.Controls 2.0
import QtQuick.Controls 2.0 as QQC2
import org.kde.kirigami 2.0 as Kirigami
Column {
......@@ -56,7 +56,7 @@ Column {
anchors.verticalCenter: parent.verticalCenter
x: Kirigami.Units.largeSpacing
}
Label {
QQC2.Label {
id: label
text: display
verticalAlignment: Text.AlignBottom
......@@ -73,7 +73,7 @@ Column {
right: pageNumber.left
}
}
Label {
QQC2.Label {
id: pageNumber
text: pageLabel ? pageLabel : page
anchors.right: parent.right
......
......@@ -18,7 +18,7 @@
*/
import QtQuick 2.2
import QtQuick.Controls 1.2 as QtControls
import QtQuick.Controls 2.2 as QQC2
import org.kde.okular 2.0
import "./private"
......@@ -28,7 +28,7 @@ import "./private"
* It supports changing pages by a swipe gesture, pinch zoom
* and flicking to scroll around
*/
QtControls.ScrollView {
QQC2.ScrollView {
id: root
property DocumentItem document
property PageItem page: mouseArea.currPageDelegate.pageItem
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment