History

Merge pull request #13838 from danteruiz/fix-hmd-debug-window

fixing scripting window visiblity and size issues

John Conklin II committed 8 years ago

Commit e578b042 parents 2ac0377 9f289711 file · +16 −9Browse files

Showing the changes to scripts/developer (1 of 1 file). Show all

Unified · Split

scripts/developer/debugging/debugWindow.js+16−9
@@ -23,7 +23,7 @@ if (scripts.length >= 2) { · 22 unmodified lines
2323 var qml = Script.resolvePath('debugWindow.qml');
2424
2525 var HMD_DEBUG_WINDOW_GEOMETRY_KEY = 'hmdDebugWindowGeometry';
26−var hmdDebugWindowGeometryValue = Settings.getValue(HMD_DEBUG_WINDOW_GEOMETRY_KEY)
26+var hmdDebugWindowGeometryValue = Settings.getValue(HMD_DEBUG_WINDOW_GEOMETRY_KEY);
2727
2828 var windowWidth = 400;
2929 var windowHeight = 900;
@@ -34,12 +34,13 @@ var windowY = 0; · 4 unmodified lines
3434
3535 if (hmdDebugWindowGeometryValue !== '') {
3636 var geometry = JSON.parse(hmdDebugWindowGeometryValue);
37−
38− windowWidth = geometry.width
39− windowHeight = geometry.height
40− windowX = geometry.x
41− windowY = geometry.y
42− hasPosition = true;
37+ if ((geometry.x !== 0) && (geometry.y !== 0)) {
38+ windowWidth = geometry.width;
39+ windowHeight = geometry.height;
40+ windowX = geometry.x;
41+ windowY = geometry.y;
42+ hasPosition = true;
43+ }
4344 }
4445
4546 var window = new OverlayWindow({
@@ -52,6 +53,12 @@ if (hasPosition) { · 6 unmodified lines
5253 window.setPosition(windowX, windowY);
5354 }
5455
56+window.visibleChanged.connect(function() {
57+ if (!window.visible) {
58+ window.setVisible(true);
59+ }
60+});
61+
5562 window.closed.connect(function () { Script.stop(); });
5663
5764 var getFormattedDate = function() {
@@ -93,10 +100,10 @@ Script.scriptEnding.connect(function () { · 35 unmodified lines
93100 y: window.position.y,
94101 width: window.size.x,
95102 height: window.size.y
96− })
103+ });
97104
98105 Settings.setValue(HMD_DEBUG_WINDOW_GEOMETRY_KEY, geometry);
99106 window.close();
100−})
107+});
101108
102109 }());