Commit 2ab3babc authored by Jonah Brüchert's avatar Jonah Brüchert
Browse files

Implement private mode

parent d300326b
......@@ -52,6 +52,7 @@ Item {
visible: navigationShown
spacing: Kirigami.Units.smallSpacing
Kirigami.Theme.inherit: true
Controls.ToolButton {
icon.name: "tab-duplicate"
......@@ -59,6 +60,8 @@ Item {
Layout.preferredWidth: buttonSize
Layout.preferredHeight: buttonSize
Kirigami.Theme.inherit: true
onClicked: {
pageStack.layers.push("Tabs.qml")
}
......@@ -73,6 +76,8 @@ Item {
visible: currentWebView.canGoBack && !Kirigami.Settings.isMobile
icon.name: "go-previous"
Kirigami.Theme.inherit: true
onClicked: currentWebView.goBack()
}
......@@ -85,6 +90,8 @@ Item {
visible: currentWebView.canGoForward && !Kirigami.Settings.isMobile
icon.name: "go-next"
Kirigami.Theme.inherit: true
onClicked: currentWebView.goForward()
}
......@@ -97,6 +104,9 @@ Item {
selectByMouse: true
focus: false
Kirigami.Theme.inherit: true
onActiveFocusChanged: {
if (activeFocus) {
selectAll()
......@@ -121,6 +131,8 @@ Item {
visible: !Kirigami.Settings.isMobile
icon.name: currentWebView.loading ? "process-stop" : "view-refresh"
Kirigami.Theme.inherit: true
onClicked: currentWebView.loading ? currentWebView.stop() : currentWebView.reload()
}
......@@ -150,6 +162,8 @@ Item {
icon.name: "open-menu-symbolic"
Kirigami.Theme.inherit: true
onClicked: contextDrawer.open()
}
}
......
......@@ -193,7 +193,9 @@ WebEngineView {
//pageInfo.url = webEngineView.url;
//pageInfo.title = webEngineView.title;
//pageInfo.icon = webEngineView.icon;
addHistoryEntry();
if (!rootPage.privateMode)
addHistoryEntry();
}
if (loadRequest.status == WebEngineView.LoadFailedStatus) {
......
......@@ -76,11 +76,14 @@ Kirigami.ApplicationWindow {
pageStack.globalToolBar.style: layerShown ? Kirigami.ApplicationHeaderStyle.Auto : Kirigami.ApplicationHeaderStyle.None
pageStack.initialPage: Kirigami.Page {
id: rootPage
leftPadding: 0
rightPadding: 0
topPadding: 0
bottomPadding: 0
property bool privateMode: false
ListWebView {
id: tabs
anchors {
......@@ -216,6 +219,13 @@ Kirigami.ApplicationWindow {
}
text: i18n("Tabs")
},
Kirigami.Action {
icon.name: "view-private"
onTriggered: {
rootPage.privateMode ? rootPage.privateMode = false : rootPage.privateMode = true
}
text: rootPage.privateMode ? i18n("Leave private mode") : i18n("Private mode")
},
Kirigami.Action {
icon.name: "bookmarks"
onTriggered: {
......@@ -298,6 +308,8 @@ Kirigami.ApplicationWindow {
id: navigation
navigationShown: !webappcontainer && webBrowser.visibility !== Window.FullScreen
Kirigami.Theme.colorSet: rootPage.privateMode ? Kirigami.Theme.Complementary : Kirigami.Theme.Window
layer.enabled: navigation.visible
layer.effect: DropShadow {
verticalOffset: - 1
......
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