mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 11:17:34 +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 qml = Script.resolvePath('debugWindow.qml');
|
||||||
|
|
||||||
var HMD_DEBUG_WINDOW_GEOMETRY_KEY = 'hmdDebugWindowGeometry';
|
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 windowWidth = 400;
|
||||||
var windowHeight = 900;
|
var windowHeight = 900;
|
||||||
|
@ -34,13 +34,14 @@ var windowY = 0;
|
||||||
|
|
||||||
if (hmdDebugWindowGeometryValue !== '') {
|
if (hmdDebugWindowGeometryValue !== '') {
|
||||||
var geometry = JSON.parse(hmdDebugWindowGeometryValue);
|
var geometry = JSON.parse(hmdDebugWindowGeometryValue);
|
||||||
|
if ((geometry.x !== 0) && (geometry.y !== 0)) {
|
||||||
windowWidth = geometry.width
|
windowWidth = geometry.width;
|
||||||
windowHeight = geometry.height
|
windowHeight = geometry.height;
|
||||||
windowX = geometry.x
|
windowX = geometry.x;
|
||||||
windowY = geometry.y
|
windowY = geometry.y;
|
||||||
hasPosition = true;
|
hasPosition = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var window = new OverlayWindow({
|
var window = new OverlayWindow({
|
||||||
title: 'Debug Window',
|
title: 'Debug Window',
|
||||||
|
@ -52,6 +53,12 @@ if (hasPosition) {
|
||||||
window.setPosition(windowX, windowY);
|
window.setPosition(windowX, windowY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.visibleChanged.connect(function() {
|
||||||
|
if (!window.visible) {
|
||||||
|
window.setVisible(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
window.closed.connect(function () { Script.stop(); });
|
window.closed.connect(function () { Script.stop(); });
|
||||||
|
|
||||||
var getFormattedDate = function() {
|
var getFormattedDate = function() {
|
||||||
|
@ -93,10 +100,10 @@ Script.scriptEnding.connect(function () {
|
||||||
y: window.position.y,
|
y: window.position.y,
|
||||||
width: window.size.x,
|
width: window.size.x,
|
||||||
height: window.size.y
|
height: window.size.y
|
||||||
})
|
});
|
||||||
|
|
||||||
Settings.setValue(HMD_DEBUG_WINDOW_GEOMETRY_KEY, geometry);
|
Settings.setValue(HMD_DEBUG_WINDOW_GEOMETRY_KEY, geometry);
|
||||||
window.close();
|
window.close();
|
||||||
})
|
});
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
Loading…
Reference in a new issue