mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 06:19:02 +02:00
Merge pull request #16398 from RebeccaStankus/grayEmoteWindow
Gray emote window
This commit is contained in:
commit
bda1e3f696
1 changed files with 20 additions and 13 deletions
|
@ -65,6 +65,15 @@ Windows.Window {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: timer
|
||||||
|
interval: 500;
|
||||||
|
repeat: false;
|
||||||
|
onTriggered: {
|
||||||
|
updateContentParent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function updateInteractiveWindowPositionForMode() {
|
function updateInteractiveWindowPositionForMode() {
|
||||||
if (presentationMode === Desktop.PresentationMode.VIRTUAL) {
|
if (presentationMode === Desktop.PresentationMode.VIRTUAL) {
|
||||||
|
@ -107,13 +116,11 @@ Windows.Window {
|
||||||
if (nativeWindow) {
|
if (nativeWindow) {
|
||||||
nativeWindow.setVisible(false);
|
nativeWindow.setVisible(false);
|
||||||
}
|
}
|
||||||
updateContentParent();
|
|
||||||
updateInteractiveWindowPositionForMode();
|
updateInteractiveWindowPositionForMode();
|
||||||
shown = interactiveWindowVisible;
|
shown = interactiveWindowVisible;
|
||||||
} else if (presentationMode === Desktop.PresentationMode.NATIVE) {
|
} else if (presentationMode === Desktop.PresentationMode.NATIVE) {
|
||||||
shown = false;
|
shown = false;
|
||||||
if (nativeWindow) {
|
if (nativeWindow) {
|
||||||
updateContentParent();
|
|
||||||
updateInteractiveWindowPositionForMode();
|
updateInteractiveWindowPositionForMode();
|
||||||
nativeWindow.setVisible(interactiveWindowVisible);
|
nativeWindow.setVisible(interactiveWindowVisible);
|
||||||
}
|
}
|
||||||
|
@ -123,10 +130,7 @@ Windows.Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
// Fix for parent loss on OSX:
|
|
||||||
parent.heightChanged.connect(updateContentParent);
|
|
||||||
parent.widthChanged.connect(updateContentParent);
|
|
||||||
|
|
||||||
x = interactiveWindowPosition.x;
|
x = interactiveWindowPosition.x;
|
||||||
y = interactiveWindowPosition.y;
|
y = interactiveWindowPosition.y;
|
||||||
width = interactiveWindowSize.width;
|
width = interactiveWindowSize.width;
|
||||||
|
@ -140,6 +144,11 @@ Windows.Window {
|
||||||
id: root;
|
id: root;
|
||||||
width: interactiveWindowSize.width
|
width: interactiveWindowSize.width
|
||||||
height: interactiveWindowSize.height
|
height: interactiveWindowSize.height
|
||||||
|
// fix for missing content on OSX initial startup with a non-maximized interface window. It seems that in this case, we cannot update
|
||||||
|
// the content parent during creation of the Window root. This added delay will update the parent after the root has finished loading.
|
||||||
|
Component.onCompleted: {
|
||||||
|
timer.start();
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: hifi.colors.baseGray
|
color: hifi.colors.baseGray
|
||||||
|
@ -170,6 +179,7 @@ Windows.Window {
|
||||||
interactiveWindowPosition = Qt.point(nativeWindow.x, interactiveWindowPosition.y);
|
interactiveWindowPosition = Qt.point(nativeWindow.x, interactiveWindowPosition.y);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
nativeWindow.yChanged.connect(function() {
|
nativeWindow.yChanged.connect(function() {
|
||||||
if (presentationMode === Desktop.PresentationMode.NATIVE && nativeWindow.visible) {
|
if (presentationMode === Desktop.PresentationMode.NATIVE && nativeWindow.visible) {
|
||||||
interactiveWindowPosition = Qt.point(interactiveWindowPosition.x, nativeWindow.y);
|
interactiveWindowPosition = Qt.point(interactiveWindowPosition.x, nativeWindow.y);
|
||||||
|
@ -181,6 +191,7 @@ Windows.Window {
|
||||||
interactiveWindowSize = Qt.size(nativeWindow.width, interactiveWindowSize.height);
|
interactiveWindowSize = Qt.size(nativeWindow.width, interactiveWindowSize.height);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
nativeWindow.heightChanged.connect(function() {
|
nativeWindow.heightChanged.connect(function() {
|
||||||
if (presentationMode === Desktop.PresentationMode.NATIVE && nativeWindow.visible) {
|
if (presentationMode === Desktop.PresentationMode.NATIVE && nativeWindow.visible) {
|
||||||
interactiveWindowSize = Qt.size(interactiveWindowSize.width, nativeWindow.height);
|
interactiveWindowSize = Qt.size(interactiveWindowSize.width, nativeWindow.height);
|
||||||
|
@ -198,11 +209,6 @@ Windows.Window {
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onDestruction: {
|
|
||||||
parent.heightChanged.disconnect(updateContentParent);
|
|
||||||
parent.widthChanged.disconnect(updateContentParent);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle message traffic from the script that launched us to the loaded QML
|
// Handle message traffic from the script that launched us to the loaded QML
|
||||||
function fromScript(message) {
|
function fromScript(message) {
|
||||||
if (root.dynamicContent && root.dynamicContent.fromScript) {
|
if (root.dynamicContent && root.dynamicContent.fromScript) {
|
||||||
|
@ -232,8 +238,8 @@ Windows.Window {
|
||||||
interactiveWindowSize.width = newWidth;
|
interactiveWindowSize.width = newWidth;
|
||||||
updateInteractiveWindowSizeForMode();
|
updateInteractiveWindowSizeForMode();
|
||||||
}
|
}
|
||||||
function onRequestNewHeight(newWidth) {
|
function onRequestNewHeight(newHeight) {
|
||||||
interactiveWindowSize.width = newWidth;
|
interactiveWindowSize.height = newHeight;
|
||||||
updateInteractiveWindowSizeForMode();
|
updateInteractiveWindowSizeForMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,6 +314,7 @@ Windows.Window {
|
||||||
onPresentationModeChanged: {
|
onPresentationModeChanged: {
|
||||||
if (initialized) {
|
if (initialized) {
|
||||||
setupPresentationMode();
|
setupPresentationMode();
|
||||||
|
updateContentParent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue