Commit caf8820c authored by Marco Martin's avatar Marco Martin

port to Kirigami 2

port kirigami 1 usage to kirigami 2
partially port to QQC2 when possible
(will need to wait newer qt versions for a full port waiting on
icons on toolbuttons and the new ScrollView
parent a2b7ce74
......@@ -19,7 +19,8 @@
import QtQuick 2.1
import QtQuick.Controls 1.3
import org.kde.kirigami 1.0 as Kirigami
import QtQuick.Controls 2.0 as QQC2
import org.kde.kirigami 2.0 as Kirigami
import Qt.labs.folderlistmodel 2.1
Item {
......@@ -35,7 +36,7 @@ Item {
id: toolBarContent
width: root.width
height: searchField.height + Kirigami.Units.gridUnit
TextField {
QQC2.TextField {
id: searchField
anchors.centerIn: parent
focus: true
......@@ -79,7 +80,7 @@ Item {
height: visible ? implicitHeight : 0
onClicked: {
documentItem.path = model.filePath;
globalDrawer.opened = false;
globalDrawer.close();
applicationWindow().controlsVisible = false;
}
}
......
......@@ -20,7 +20,7 @@
import QtQuick 2.1
import QtQuick.Controls 1.3
import org.kde.okular 2.0 as Okular
import org.kde.kirigami 1.0 as Kirigami
import org.kde.kirigami 2.0 as Kirigami
Kirigami.Page {
property alias document: pageArea.document
......
......@@ -18,8 +18,10 @@
*/
import QtQuick 2.1
//still needed for icons in toolbuttons
import QtQuick.Controls 1.3
import org.kde.kirigami 1.0 as Kirigami
import QtQuick.Controls 2.0 as QQC2
import org.kde.kirigami 2.0 as Kirigami
import org.kde.kquickcontrolsaddons 2.0
import org.kde.okular 2.0 as Okular
......@@ -45,10 +47,10 @@ Kirigami.OverlayDrawer {
Connections {
target: documentItem
onPathChanged: mainTabBar.currentTab = thumbnailsButton;
onPathChanged: thumbnailsButton.checked = true;
}
ToolBar {
QQC2.ToolBar {
id: tabsToolbar
height: mainTabBar.height
anchors {
......@@ -69,7 +71,7 @@ Kirigami.OverlayDrawer {
ExclusiveGroup { id: tabPositionGroup }
ToolButton {
id: thumbnailsButton
text: tabsToolbar.width > units.gridUnit * 30 ? i18n("Thumbnails") : ""
text: tabsToolbar.width > Kirigami.Units.gridUnit * 30 ? i18n("Thumbnails") : ""
iconName: "view-preview"
checkable: true
//Hint for Plasma style
......@@ -84,7 +86,7 @@ Kirigami.OverlayDrawer {
ToolButton {
id: tocButton
enabled: documentItem.tableOfContents.count > 0
text: tabsToolbar.width > units.gridUnit * 30 ? i18n("Table of contents") : ""
text: tabsToolbar.width > Kirigami.Units.gridUnit * 30 ? i18n("Table of contents") : ""
iconName: "view-table-of-contents-ltr"
checkable: true
property bool flat: false
......@@ -98,7 +100,7 @@ Kirigami.OverlayDrawer {
ToolButton {
id: bookmarksButton
enabled: documentItem.bookmarkedPages.length > 0
text: tabsToolbar.width > units.gridUnit * 30 ? i18n("Bookmarks") : ""
text: tabsToolbar.width > Kirigami.Units.gridUnit * 30 ? i18n("Bookmarks") : ""
iconName: "bookmarks-organize"
checkable: true
property bool flat: false
......
......@@ -19,7 +19,8 @@
import QtQuick 2.1
import QtQuick.Controls 1.3
import org.kde.kirigami 1.0 as Kirigami
import QtQuick.Controls 2.0 as QQC2
import org.kde.kirigami 2.0 as Kirigami
Kirigami.Page {
id: root
......@@ -30,11 +31,11 @@ Kirigami.Page {
property alias contentY: flickable.contentY
property alias contentHeight: flickable.contentHeight
ToolBar {
QQC2.ToolBar {
id: toolBarContent
width: root.width
height: searchField.height
TextField {
QQC2.TextField {
id: searchField
anchors.centerIn: parent
}
......
......@@ -18,8 +18,8 @@
*/
import QtQuick 2.1
import QtQuick.Controls 1.3
import org.kde.kirigami 1.0 as Kirigami
import QtQuick.Controls 2.0
import org.kde.kirigami 2.0 as Kirigami
ThumbnailsBase {
id: root
......@@ -31,7 +31,7 @@ ThumbnailsBase {
height: searchField.height
TextField {
id: searchField
enabled: documentItem.supportsSearch
enabled: documentItem ? documentItem.supportsSearch : false
anchors.centerIn: parent
onTextChanged: {
if (text.length > 2) {
......
......@@ -21,7 +21,7 @@ import QtQuick 2.1
import QtQuick.Controls 1.3
import QtGraphicalEffects 1.0
import org.kde.okular 2.0 as Okular
import org.kde.kirigami 1.0 as Kirigami
import org.kde.kirigami 2.0 as Kirigami
Kirigami.Page {
id: root
......@@ -75,7 +75,7 @@ Kirigami.Page {
Rectangle {
width: childrenRect.width
height: childrenRect.height
color: theme.backgroundColor
color: Kirigami.Theme.backgroundColor
radius: width
smooth: true
anchors {
......
......@@ -19,7 +19,7 @@
import QtQuick 2.1
import org.kde.kquickcontrolsaddons 2.0
import org.kde.kirigami 1.0 as Kirigami
import org.kde.kirigami 2.0 as Kirigami
Column {
id: treeDelegate
......
......@@ -20,7 +20,7 @@
import QtQuick 2.1
import QtQuick.Controls 1.3
import org.kde.okular 2.0 as Okular
import org.kde.kirigami 1.0 as Kirigami
import org.kde.kirigami 2.0 as Kirigami
Kirigami.AbstractApplicationWindow {
id: fileBrowserRoot
......@@ -37,10 +37,12 @@ Kirigami.AbstractApplicationWindow {
globalDrawer: Kirigami.OverlayDrawer {
edge: Qt.LeftEdge
contentItem: Documents {
implicitWidth: units.gridUnit * 20
implicitWidth: Kirigami.Units.gridUnit * 20
}
}
contextDrawer: OkularDrawer {}
contextDrawer: OkularDrawer {
drawerOpen: false
}
Okular.DocumentItem {
id: documentItem
......@@ -65,7 +67,7 @@ Kirigami.AbstractApplicationWindow {
}
if (commandlineArguments.length == 0) {
globalDrawer.opened = true;
globalDrawer.open();
}
}
}
......
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