Make tool window closable

This commit is contained in:
Brad Davis 2016-01-24 13:55:31 -08:00
parent 8ed5ea8605
commit 79e6aaf17f

View file

@ -13,7 +13,7 @@ Windows.Window {
objectName: "ToolWindow" objectName: "ToolWindow"
destroyOnCloseButton: false destroyOnCloseButton: false
destroyOnInvisible: false destroyOnInvisible: false
closable: false closable: true
visible: false visible: false
width: 384; height: 640; width: 384; height: 640;
property string newTabSource property string newTabSource
@ -54,17 +54,12 @@ Windows.Window {
} }
function updateVisiblity() { function updateVisiblity() {
var newVisible = false
console.log("Checking " + tabView.count + " children")
for (var i = 0; i < tabView.count; ++i) { for (var i = 0; i < tabView.count; ++i) {
if (tabView.getTab(i).enabled) { if (tabView.getTab(i).enabled) {
console.log("Tab " + i + " enabled"); return;
newVisible = true;
break;
} }
} }
console.log("Setting toolWindow visible: " + newVisible); visible = false;
visible = newVisible
} }
function findIndexForUrl(source) { function findIndexForUrl(source) {
@ -127,7 +122,6 @@ Windows.Window {
var title = properties.title || "Unknown"; var title = properties.title || "Unknown";
newTabSource = properties.source; newTabSource = properties.source;
console.log(typeof(properties.source))
var newTab = tabView.addTab(title, webTabCreator); var newTab = tabView.addTab(title, webTabCreator);
newTab.active = true; newTab.active = true;
newTab.enabled = false; newTab.enabled = false;