Commit 3a763498 authored by Marco Martin's avatar Marco Martin
Browse files

use opacity instead of visible

Summary:
Qt documentation recomends to bind to opacity instead of visible as visible
cascades down. The tabbar used to trigger its height behavior anim when the
popup got hidden, binding to opacity (even if opacity isn't animated) is a
more correct behavior.
Plus with visible it triggers the Qt bug https://bugreports.qt.io/browse/QTBUG-66907
which in turn triggers https://bugs.kde.org/show_bug.cgi?id=391432

BUG:391432

Test Plan: kickoff never opens the last tab anymore

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D11098
parent c736f2e8
......@@ -342,7 +342,7 @@ Item {
property int count: 5 // updated in createButtons()
width: {
if (!visible) {
if (opacity == 0) {
return 0;
}
......@@ -356,7 +356,7 @@ Item {
}
height: {
if (!visible) {
if (opacity == 0) {
return 0;
}
......@@ -490,7 +490,12 @@ Item {
}
PropertyChanges {
target: tabBar
visible: tabBar.count > 1
//Set the opacity and NOT the visibility, as visibility is recursive
//and this binding would be executed also on popup show/hide
//as recomended by the docs: http://doc.qt.io/qt-5/qml-qtquick-item.html#visible-prop
//plus, it triggers https://bugreports.qt.io/browse/QTBUG-66907
//in which a mousearea may think it's under the mouse while it isn't
opacity: tabBar.count > 1 ? 1 : 0
}
},
State {
......@@ -501,14 +506,14 @@ Item {
}
PropertyChanges {
target: tabBar
visible: tabBar.count > 1
opacity: tabBar.count > 1 ? 1 : 0
}
},
State {
name: "Search"
PropertyChanges {
target: tabBar
visible: false
opacity: 0
}
PropertyChanges {
target: mainTabGroup
......
Supports Markdown
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