Merge pull request #10058 from hyperlogic/bug-fix/toolbar-hiding-woes

Fix for disappearing toolbar after reload all scripts
This commit is contained in:
Seth Alves 2017-03-29 16:04:37 -07:00 committed by GitHub
commit 5375b87297
2 changed files with 5 additions and 29 deletions

View file

@ -55,7 +55,7 @@ OriginalDesktop.Desktop {
// Literal 50 is overwritten by settings from previous session, and sysToolbar.x comes from settings when not constrained.
x: sysToolbar.x
y: 50
shown: false
shown: true
}
Settings {

View file

@ -49,7 +49,6 @@ Window {
id: content
implicitHeight: horizontal ? row.height : column.height
implicitWidth: horizontal ? row.width : column.width
property bool wasVisibleBeforeBeingPinned: false
Row {
id: row
@ -62,18 +61,6 @@ Window {
}
Component { id: toolbarButtonBuilder; ToolbarButton { } }
Connections {
target: desktop
onPinnedChanged: {
if (desktop.pinned) {
content.wasVisibleBeforeBeingPinned = window.visible;
window.visible = false;
} else {
window.visible = content.wasVisibleBeforeBeingPinned;
}
}
}
}
@ -136,10 +123,11 @@ Window {
buttons.push(result);
result.opacity = 1;
updatePinned();
sortButtons();
shown = true;
return result;
}
@ -149,24 +137,12 @@ Window {
console.warn("Tried to remove non-existent button " + name);
return;
}
buttons[index].destroy();
buttons.splice(index, 1);
updatePinned();
if (buttons.length === 0) {
fadeOut(function () {});
shown = false;
}
}
function updatePinned() {
var newPinned = false;
for (var i in buttons) {
var child = buttons[i];
if (child.pinned) {
newPinned = true;
break;
}
}
pinned = newPinned;
}
}