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

0001 // SPDX-FileCopyrightText: 2014-2015 Sebastian Kügler <sebas@kde.org>
0002 //
0003 // SPDX-License-Identifier: GPL-2.0-or-later
0004 
0005 import QtQuick 2.1
0006 import QtWebEngine 1.6
0007 import QtQuick.Window 2.3
0008 import Qt5Compat.GraphicalEffects
0009 import Qt.labs.settings 1.0 as QtSettings
0010 
0011 import org.kde.kirigami 2.7 as Kirigami
0012 import org.kde.angelfish 1.0
0013 
0014 import QtQuick.Layouts 1.2
0015 
0016 Kirigami.ApplicationWindow {
0017     id: webBrowser
0018     title: currentWebView.title
0019 
0020     minimumWidth: Kirigami.Units.gridUnit * 15
0021     minimumHeight: Kirigami.Units.gridUnit * 15
0022 
0023     pageStack.globalToolBar.showNavigationButtons: Kirigami.ApplicationHeaderStyle.NoNavigationButtons
0024 
0025     // Main Page
0026     pageStack.initialPage: Kirigami.Page {
0027         id: rootPage
0028         leftPadding: 0
0029         rightPadding: 0
0030         topPadding: 0
0031         bottomPadding: 0
0032         globalToolBarStyle: Kirigami.ApplicationHeaderStyle.None
0033         Kirigami.ColumnView.fillWidth: true
0034         Kirigami.ColumnView.pinned: true
0035         Kirigami.ColumnView.preventStealing: true
0036 
0037         property alias questions: questions
0038 
0039         WebAppView {
0040             // ID for compatibility with angelfish components
0041             id: currentWebView
0042             anchors.fill: parent
0043             url: BrowserManager.initialUrl
0044         }
0045         ErrorHandler {
0046             id: errorHandler
0047 
0048             errorString: currentWebView.errorString
0049             errorCode: currentWebView.errorCode
0050 
0051             anchors.fill: parent
0052             visible: currentWebView.errorCode !== ""
0053             onRefreshRequested: currentWebView.reload()
0054         }
0055 
0056         Loader {
0057             id: questionLoader
0058 
0059             anchors.bottom: parent.bottom
0060             anchors.left: parent.left
0061             anchors.right: parent.right
0062         }
0063 
0064         Questions {
0065             id: questions
0066 
0067             anchors.bottom: parent.bottom
0068             anchors.left: parent.left
0069             anchors.right: parent.right
0070         }
0071 
0072         // Container for the progress bar
0073         Item {
0074             id: progressItem
0075 
0076             height: Math.round(Kirigami.Units.gridUnit / 6)
0077             z: 99
0078             anchors {
0079                 bottom: parent.bottom
0080                 bottomMargin: -Math.round(height / 2)
0081                 left: webBrowser.left
0082                 right: webBrowser.right
0083             }
0084 
0085             opacity: currentWebView.loading ? 1 : 0
0086             Behavior on opacity { NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad; } }
0087 
0088             Rectangle {
0089                 color: Kirigami.Theme.highlightColor
0090 
0091                 width: Math.round((currentWebView.loadProgress / 100) * parent.width)
0092                 anchors {
0093                     top: parent.top
0094                     left: parent.left
0095                     bottom: parent.bottom
0096                 }
0097             }
0098         }
0099 
0100         Loader {
0101             id: sheetLoader
0102         }
0103     }
0104 }