Verified Commit 5ea41d12 authored by Jonah Brüchert's avatar Jonah Brüchert
Browse files

Implement fullscreen

parent 9ec0b0b4
......@@ -30,16 +30,14 @@ import "regex-weburl.js" as RegexWebUrl
Item {
id: errorHandler
id: navigation
property string errorCode: ""
property bool navigationShown: errorCode != "" || webBrowser.url === "" || true
property bool navigationShown: true
property alias textFocus: urlInput.activeFocus
property alias text: urlInput.text
property int expandedHeight: Kirigami.Units.gridUnit * 2.5
property int expandedHeight: Kirigami.Units.gridUnit * 3
property int buttonSize: Kirigami.Units.gridUnit * 2
Behavior on height { NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad} }
......@@ -156,12 +154,12 @@ Item {
State {
name: "shown"
when: navigationShown
PropertyChanges { target: errorHandler; x: -expandedHeight}
PropertyChanges { target: navigation; height: expandedHeight}
},
State {
name: "hidden"
when: !navigationShown
PropertyChanges { target: errorHandler; x: 0}
PropertyChanges { target: navigation; height: 0}
}
]
......
......@@ -21,6 +21,7 @@
import QtQuick 2.3
import QtQuick.Controls 2.4 as Controls
import QtQuick.Window 2.1
import QtWebEngine 1.7
......@@ -153,6 +154,14 @@ WebEngineView {
}
}
onFullScreenRequested: {
request.accept()
if (webBrowser.visibility !== Window.FullScreen)
webBrowser.showFullScreen()
else
webBrowser.showNormal()
}
onContextMenuRequested: {
request.accepted = true;
contextMenu.request = request
......
......@@ -21,7 +21,7 @@
import QtQuick 2.1
import QtWebEngine 1.6
import QtQuick.Window 2.1
import QtQuick.Window 2.3
import org.kde.kirigami 2.4 as Kirigami
......@@ -171,21 +171,13 @@ Kirigami.ApplicationWindow {
Navigation {
id: navigation
visible: !webappcontainer
height: {
if (!webappcontainer)
return Kirigami.Units.gridUnit * 3
else
return 0
}
navigationShown: !webappcontainer && webBrowser.visibility !== Window.FullScreen
anchors {
top: parent.top
left: parent.left
right: parent.right
}
onTextChanged: urlFilter.setFilterFixedString(text)
}
......
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