mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 21:16:00 +02:00
Make tool window closable
This commit is contained in:
parent
8ed5ea8605
commit
79e6aaf17f
1 changed files with 3 additions and 9 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue