mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-08 01:42:25 +02:00
Merge pull request #13838 from danteruiz/fix-hmd-debug-window
fixing scripting window visiblity and size issues
This commit is contained in:
commit
e578b047b0
1 changed files with 16 additions and 9 deletions
|
@ -23,7 +23,7 @@ if (scripts.length >= 2) {
|
|||
var qml = Script.resolvePath('debugWindow.qml');
|
||||
|
||||
var HMD_DEBUG_WINDOW_GEOMETRY_KEY = 'hmdDebugWindowGeometry';
|
||||
var hmdDebugWindowGeometryValue = Settings.getValue(HMD_DEBUG_WINDOW_GEOMETRY_KEY)
|
||||
var hmdDebugWindowGeometryValue = Settings.getValue(HMD_DEBUG_WINDOW_GEOMETRY_KEY);
|
||||
|
||||
var windowWidth = 400;
|
||||
var windowHeight = 900;
|
||||
|
@ -34,12 +34,13 @@ var windowY = 0;
|
|||
|
||||
if (hmdDebugWindowGeometryValue !== '') {
|
||||
var geometry = JSON.parse(hmdDebugWindowGeometryValue);
|
||||
|
||||
windowWidth = geometry.width
|
||||
windowHeight = geometry.height
|
||||
windowX = geometry.x
|
||||
windowY = geometry.y
|
||||
hasPosition = true;
|
||||
if ((geometry.x !== 0) && (geometry.y !== 0)) {
|
||||
windowWidth = geometry.width;
|
||||
windowHeight = geometry.height;
|
||||
windowX = geometry.x;
|
||||
windowY = geometry.y;
|
||||
hasPosition = true;
|
||||
}
|
||||
}
|
||||
|
||||
var window = new OverlayWindow({
|
||||
|
@ -52,6 +53,12 @@ if (hasPosition) {
|
|||
window.setPosition(windowX, windowY);
|
||||
}
|
||||
|
||||
window.visibleChanged.connect(function() {
|
||||
if (!window.visible) {
|
||||
window.setVisible(true);
|
||||
}
|
||||
});
|
||||
|
||||
window.closed.connect(function () { Script.stop(); });
|
||||
|
||||
var getFormattedDate = function() {
|
||||
|
@ -93,10 +100,10 @@ Script.scriptEnding.connect(function () {
|
|||
y: window.position.y,
|
||||
width: window.size.x,
|
||||
height: window.size.y
|
||||
})
|
||||
});
|
||||
|
||||
Settings.setValue(HMD_DEBUG_WINDOW_GEOMETRY_KEY, geometry);
|
||||
window.close();
|
||||
})
|
||||
});
|
||||
|
||||
}());
|
||||
|
|
Loading…
Reference in a new issue