Warning, /network/angelfish/src/contents/ui/HistorySheet.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: 2019 Simon Schmeisser <s.schmeisser@gmx.net>
0002 // SPDX-FileCopyrightText: 2019 Jonah BrĂ¼chert <jbb@kaidan.im>
0003 // SPDX-FileCopyrightText: 2020 Rinigus <rinigus.git@gmail.com>
0004 //
0005 // SPDX-License-Identifier: GPL-2.0-or-later
0006 
0007 import QtQuick 2.7
0008 import QtQuick.Controls 2.2 as Controls
0009 import QtQuick.Layouts 1.2
0010 
0011 import org.kde.kirigami 2.5 as Kirigami
0012 import org.kde.angelfish 1.0
0013 
0014 Controls.Drawer {
0015     id: overlay
0016     dragMargin: 0
0017     edge: Qt.BottomEdge
0018     width: parent.width
0019 
0020     property bool backHistory: true
0021 
0022     property int itemHeight: Kirigami.Units.gridUnit * 3
0023 
0024     property int fullHeight: Math.min(Math.max(itemHeight * 1, listView.contentHeight) + itemHeight,
0025                                       0.9 * rootPage.height)
0026 
0027     contentHeight: fullHeight
0028     contentWidth: parent.width
0029     contentItem: ListView {
0030         id: listView
0031         anchors.fill: parent
0032 
0033         boundsBehavior: Flickable.StopAtBounds
0034         clip: true
0035 
0036         delegate: UrlDelegate {
0037             showRemove: false
0038             onClicked: {
0039                 currentWebView.goBackOrForward(model.offset);
0040                 overlay.close();
0041             }
0042         }
0043 
0044         model: overlay.backHistory ? currentWebView.navigationHistory.backItems :
0045                                      currentWebView.navigationHistory.forwardItems
0046     }
0047 
0048     onClosed: {
0049         currentWebView.forceActiveFocus();
0050     }
0051 }