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
23var qml = Script.resolvePath('debugWindow.qml');23var qml = Script.resolvePath('debugWindow.qml');
24 24
25var HMD_DEBUG_WINDOW_GEOMETRY_KEY = 'hmdDebugWindowGeometry';25var HMD_DEBUG_WINDOW_GEOMETRY_KEY = 'hmdDebugWindowGeometry';
26var hmdDebugWindowGeometryValue = Settings.getValue(HMD_DEBUG_WINDOW_GEOMETRY_KEY)26var hmdDebugWindowGeometryValue = Settings.getValue(HMD_DEBUG_WINDOW_GEOMETRY_KEY);
27 27
28var windowWidth = 400;28var windowWidth = 400;
29var windowHeight = 900;29var windowHeight = 900;
@@ -34,12 +34,13 @@ var windowY = 0; · 4 unmodified lines
34 34
35if (hmdDebugWindowGeometryValue !== '') {35if (hmdDebugWindowGeometryValue !== '') {
36 var geometry = JSON.parse(hmdDebugWindowGeometryValue);36 var geometry = JSON.parse(hmdDebugWindowGeometryValue);
37 37 if ((geometry.x !== 0) && (geometry.y !== 0)) {
38 windowWidth = geometry.width38 windowWidth = geometry.width;
39 windowHeight = geometry.height39 windowHeight = geometry.height;
40 windowX = geometry.x40 windowX = geometry.x;
41 windowY = geometry.y41 windowY = geometry.y;
42 hasPosition = true;42 hasPosition = true;
43 }
43}44}
44 45
45var window = new OverlayWindow({46var window = new OverlayWindow({
@@ -52,6 +53,12 @@ if (hasPosition) { · 6 unmodified lines
52 window.setPosition(windowX, windowY);53 window.setPosition(windowX, windowY);
53}54}
54 55
56window.visibleChanged.connect(function() {
57 if (!window.visible) {
58 window.setVisible(true);
59 }
60});
61
55window.closed.connect(function () { Script.stop(); });62window.closed.connect(function () { Script.stop(); });
56 63
57var getFormattedDate = function() {64var getFormattedDate = function() {
@@ -93,10 +100,10 @@ Script.scriptEnding.connect(function () { · 35 unmodified lines
93 y: window.position.y,100 y: window.position.y,
94 width: window.size.x,101 width: window.size.x,
95 height: window.size.y102 height: window.size.y
96 })103 });
97 104
98 Settings.setValue(HMD_DEBUG_WINDOW_GEOMETRY_KEY, geometry);105 Settings.setValue(HMD_DEBUG_WINDOW_GEOMETRY_KEY, geometry);
99 window.close();106 window.close();
100})107});
101 108
102}());109}());