Verified Commit fc2f00f6 authored by Rinigus Saar's avatar Rinigus Saar Committed by Jonah Brüchert
Browse files

hide tabs by moving them out of image

When tabs are made invisible through visible property,
their live representation in tabs selector is not available.
By moving inactive tabs out of borders, live preview is kept
parent 75f64730
......@@ -29,13 +29,11 @@ import QtWebEngine 1.6
Repeater {
id: tabs
clip: true
property int currentIndex: -1
property var currentItem
property int pageHeight: height
property int pageWidth: width
property alias count: tabsModel.count
model: ListModel {
......@@ -44,10 +42,19 @@ Repeater {
delegate: WebView {
id: wv
anchors.fill: tabs
anchors {
bottom: tabs.bottom
top: tabs.top
}
url: pageurl;
visible: index === tabs.currentIndex
onVisibleChanged: if (visible) tabs.currentItem = wv
width: tabs.width
property bool showView: index === tabs.currentIndex
x: showView ? 0 : -width
z: showView ? 1000 : 0
onShowViewChanged: if (showView) tabs.currentItem = wv
}
function createEmptyTab(front) {
......
......@@ -37,9 +37,6 @@ WebEngineView {
property alias userAgent: userAgent
width: pageWidth
height: pageHeight
UserAgentGenerator {
id: userAgent
isMobile: Kirigami.Settings.isMobile
......
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