Commit 6b78bb4f authored by Rinigus Saar's avatar Rinigus Saar

Add current tab history sheet

parent 51a0ae5f
......@@ -66,7 +66,10 @@ Kirigami.ScrollablePage {
UrlDelegate {
highlightText: list.model.filter
onClicked: pageStack.pop()
onClicked: {
currentWebView.url = url;
pageStack.pop();
}
onRemoved: BrowserManager.removeBookmark(url);
}
}
......
......@@ -66,7 +66,10 @@ Kirigami.ScrollablePage {
UrlDelegate {
highlightText: list.model.filter
onClicked: pageStack.pop()
onClicked: {
currentWebView.url = url;
pageStack.pop();
}
onRemoved: BrowserManager.removeFromHistory(url);
}
}
......
/***************************************************************************
* *
* Copyright 2019 Simon Schmeisser <s.schmeisser@gmx.net> *
* Copyright 2019 Jonah Brüchert <jbb@kaidan.im> *
* Copyright 2020 Rinigus <rinigus.git@gmail.com> *
* *
* 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 of the License, 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.7
import QtQuick.Controls 2.2 as Controls
import QtQuick.Layouts 1.2
import org.kde.kirigami 2.5 as Kirigami
import org.kde.mobile.angelfish 1.0
Controls.Drawer {
id: overlay
dragMargin: 0
edge: Qt.BottomEdge
width: parent.width
property bool backHistory: true
property int itemHeight: Kirigami.Units.gridUnit * 3
property int fullHeight: Math.min(Math.max(itemHeight * 1, listView.contentHeight) + itemHeight,
0.9 * rootPage.height)
contentHeight: fullHeight
contentWidth: parent.width
contentItem: ListView {
id: listView
anchors.fill: parent
boundsBehavior: Flickable.StopAtBounds
clip: true
delegate: UrlDelegate {
showRemove: false
onClicked: {
currentWebView.goBackOrForward(model.offset);
overlay.close();
}
}
model: overlay.backHistory ? currentWebView.navigationHistory.backItems :
currentWebView.navigationHistory.forwardItems
}
onClosed: {
currentWebView.forceActiveFocus();
}
}
......@@ -115,6 +115,10 @@ Item {
Kirigami.Theme.inherit: true
onClicked: currentWebView.goBack()
onPressAndHold: {
historySheet.backHistory = true;
historySheet.open();
}
}
Controls.ToolButton {
......@@ -129,6 +133,10 @@ Item {
Kirigami.Theme.inherit: true
onClicked: currentWebView.goForward()
onPressAndHold: {
historySheet.backHistory = false;
historySheet.open();
}
}
Controls.ToolButton {
......
......@@ -133,7 +133,10 @@ Controls.Drawer {
delegate: UrlDelegate {
showRemove: false
onClicked: overlay.close()
onClicked: {
currentWebView.url = url;
overlay.close();
}
highlightText: urlFilter.filter
width: parent.width
}
......
......@@ -64,7 +64,7 @@ Kirigami.SwipeListItem {
// title
Controls.Label {
text: title ? title.replace(regex, highlightedText) : ""
text: title ? (highlightText ? title.replace(regex, highlightedText) : title) : ""
elide: Qt.ElideRight
maximumLineCount: 1
Layout.fillWidth: true
......@@ -72,7 +72,7 @@ Kirigami.SwipeListItem {
// url
Controls.Label {
text: url ? url.replace(regex, highlightedText) : ""
text: url ? (highlightText ? url.replace(regex, highlightedText) : url) : ""
opacity: 0.6
elide: Qt.ElideRight
maximumLineCount: 1
......
......@@ -341,6 +341,10 @@ Kirigami.ApplicationWindow {
id: urlEntry
}
HistorySheet {
id: historySheet
}
// Thin line above navigation or find
Rectangle {
height: webBrowser.borderWidth
......
......@@ -3,6 +3,7 @@
<file alias="Bookmarks.qml">contents/ui/Bookmarks.qml</file>
<file alias="ErrorHandler.qml">contents/ui/ErrorHandler.qml</file>
<file alias="History.qml">contents/ui/History.qml</file>
<file alias="HistorySheet.qml">contents/ui/HistorySheet.qml</file>
<file alias="ListWebView.qml">contents/ui/ListWebView.qml</file>
<file alias="Navigation.qml">contents/ui/Navigation.qml</file>
<file alias="Settings.qml">contents/ui/Settings.qml</file>
......
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