Commit 6af67420 authored by Carl Schwan's avatar Carl Schwan 🚴 Committed by Albert Astals Cid
Browse files

Visual improvements to drawer

Now the drawer open automatically when the window is big enough. The
drawer handle are also only visible when a document is open. The
thumbnails page was also improved and some spacing issues were solved.
parent 604a4e1d
Pipeline #43669 passed with stage
in 10 minutes and 50 seconds
......@@ -24,7 +24,12 @@ import org.kde.okular 2.0 as Okular
Kirigami.OverlayDrawer {
edge: Qt.RightEdge
bottomPadding: 0
topPadding: 0
leftPadding: 0
rightPadding: 0
edge: Qt.application.layoutDirection == Qt.RightToLeft ? Qt.LeftEdge : Qt.RightEdge
contentItem: Item {
id: browserFrame
implicitWidth: Kirigami.Units.gridUnit * 45
......
......@@ -24,13 +24,13 @@ import org.kde.kirigami 2.8 as Kirigami
ThumbnailsBase {
id: root
model: documentItem.matchingPages
padding: 0
header: QQC2.ToolBar {
id: toolBarContent
width: root.width
Kirigami.SearchField {
padding: 0
contentItem: Kirigami.SearchField {
id: searchField
width: parent.width
placeholderText: i18n("Search...")
enabled: documentItem ? documentItem.supportsSearching : false
onTextChanged: {
......
......@@ -29,23 +29,22 @@ Kirigami.ScrollablePage {
property Item view: resultsGrid
signal pageClicked(int pageNumber)
QQC2.Label {
anchors.centerIn: parent
visible: model.length == 0
text: i18n("No results found.")
}
Kirigami.CardsListView {
contentItem: Kirigami.CardsListView {
id: resultsGrid
clip: true
leftMargin: Kirigami.Units.largeSpacing * 10
rightMargin: Kirigami.Units.largeSpacing * 10
QQC2.Label {
anchors.centerIn: parent
visible: model.length == 0
text: i18n("No results found.")
}
delegate: Kirigami.AbstractCard {
implicitWidth: root.width
highlighted: delegateRecycler && delegateRecycler.GridView.isCurrentItem
showClickFeedback: true
readonly property real ratio: contentItem.implicitHeight/contentItem.implicitWidth
height: width * ratio
implicitHeight: width * ratio
contentItem: Okular.ThumbnailItem {
document: documentItem
pageNumber: modelData
......
......@@ -24,10 +24,15 @@ import org.kde.kirigami 2.10 as Kirigami
import org.kde.okular.app 2.0
Kirigami.ApplicationWindow {
id: fileBrowserRoot
id: root
readonly property int columnWidth: Kirigami.Units.gridUnit * 13
wideScreen: width > columnWidth * 5
visible: true
header: null
globalDrawer: Kirigami.GlobalDrawer {
title: i18n("Okular")
titleIcon: "okular"
......@@ -57,7 +62,13 @@ Kirigami.ApplicationWindow {
}
]
}
contextDrawer: OkularDrawer {}
contextDrawer: OkularDrawer {
contentItem.implicitWidth: columnWidth
modal: !root.wideScreen
onModalChanged: drawerOpen = !modal
enabled: documentItem.opened && pageStack.layers.depth < 2
handleVisible: enabled && pageStack.layers.depth < 2
}
title: documentItem.windowTitleForDocument ? documentItem.windowTitleForDocument : i18n("Okular")
Okular.DocumentItem {
......
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