Fix for toolbar visibility after snapshots.

This commit is contained in:
Anthony J. Thibault 2017-02-17 11:04:04 -08:00
parent e4076e6244
commit 5963c6ddc3

View file

@ -25,7 +25,7 @@ Window {
property real buttonSize: 50; property real buttonSize: 50;
property var buttons: [] property var buttons: []
property var container: horizontal ? row : column property var container: horizontal ? row : column
Settings { Settings {
category: "toolbar/" + window.objectName category: "toolbar/" + window.objectName
property alias x: window.x property alias x: window.x
@ -49,6 +49,7 @@ Window {
id: content id: content
implicitHeight: horizontal ? row.height : column.height implicitHeight: horizontal ? row.height : column.height
implicitWidth: horizontal ? row.width : column.width implicitWidth: horizontal ? row.width : column.width
property bool wasVisibleBeforeBeingPinned: false
Row { Row {
id: row id: row
@ -65,19 +66,11 @@ Window {
Connections { Connections {
target: desktop target: desktop
onPinnedChanged: { onPinnedChanged: {
if (!window.pinned) { if (desktop.pinned) {
return; content.wasVisibleBeforeBeingPinned = window.visible;
} window.visible = false;
var newPinned = desktop.pinned; } else {
for (var i in buttons) { window.visible = content.wasVisibleBeforeBeingPinned;
var child = buttons[i];
if (desktop.pinned) {
if (!child.pinned) {
child.visible = false;
}
} else {
child.visible = true;
}
} }
} }
} }