mirror of
https://github.com/lubosz/overte.git
synced 2025-04-09 14:34:02 +02:00
Fix emote bar always visible on MacOS; small logic cleanup
This commit is contained in:
parent
63d27fb002
commit
177590614e
3 changed files with 24 additions and 3 deletions
|
@ -56,6 +56,7 @@ WindowScriptingInterface::WindowScriptingInterface() {
|
|||
});
|
||||
|
||||
connect(qApp->getWindow(), &MainWindow::windowGeometryChanged, this, &WindowScriptingInterface::onWindowGeometryChanged);
|
||||
connect(qApp->getWindow(), &MainWindow::windowMinimizedChanged, this, &WindowScriptingInterface::minimizedChanged);
|
||||
connect(qApp, &Application::interstitialModeChanged, [this] (bool interstitialMode) {
|
||||
emit interstitialModeChanged(interstitialMode);
|
||||
});
|
||||
|
|
|
@ -814,6 +814,17 @@ signals:
|
|||
*/
|
||||
void geometryChanged(QRect geometry);
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* Triggered when "minimized" state of the Interface window changes.
|
||||
* @function Window.minimizedChanged
|
||||
* @param {bool} isMinimized - true if the Interface window is now minimized; false otherwise.
|
||||
* @returns {Signal}
|
||||
*
|
||||
* Window.minimizedChanged.connect(onWindowMinimizedChanged);
|
||||
*/
|
||||
void minimizedChanged(bool isMinimized);
|
||||
|
||||
private:
|
||||
QString getPreviousBrowseLocation() const;
|
||||
void setPreviousBrowseLocation(const QString& location);
|
||||
|
|
|
@ -349,6 +349,15 @@ function onGeometryChanged(rect) {
|
|||
}
|
||||
|
||||
|
||||
function onWindowMinimizedChanged(isMinimized) {
|
||||
if (isMinimized) {
|
||||
handleEmoteIndicatorVisibleChanged(false);
|
||||
} else if (!HMD.active && Settings.getValue("simplifiedUI/emoteIndicatorVisible", true)) {
|
||||
handleEmoteIndicatorVisibleChanged(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// These keys need to match what's in `SimplifiedEmoteIndicator.qml` in the `buttonsModel`
|
||||
// for the tooltips to match the actual keys.
|
||||
var POSITIVE_KEY = "z";
|
||||
|
@ -450,9 +459,7 @@ function handleEmoteIndicatorVisibleChanged(newValue) {
|
|||
if (newValue && !emoteAppBarWindow) {
|
||||
showEmoteAppBar();
|
||||
} else if (emoteAppBarWindow) {
|
||||
if (emoteAppBarWindow) {
|
||||
emoteAppBarWindow.fromQml.disconnect(onMessageFromEmoteAppBar);
|
||||
}
|
||||
emoteAppBarWindow.fromQml.disconnect(onMessageFromEmoteAppBar);
|
||||
emoteAppBarWindow.close();
|
||||
emoteAppBarWindow = false;
|
||||
}
|
||||
|
@ -509,6 +516,7 @@ function init() {
|
|||
}
|
||||
}, {});
|
||||
|
||||
Window.minimizedChanged.connect(onWindowMinimizedChanged);
|
||||
Window.geometryChanged.connect(onGeometryChanged);
|
||||
Settings.valueChanged.connect(onSettingsValueChanged);
|
||||
HMD.displayModeChanged.connect(onDisplayModeChanged);
|
||||
|
@ -544,6 +552,7 @@ function shutdown() {
|
|||
maybeClearClapSoundInterval();
|
||||
maybeClearReticleUpdateLimiterTimeout();
|
||||
|
||||
Window.minimizedChanged.disconnect(onWindowMinimizedChanged);
|
||||
Window.geometryChanged.disconnect(onGeometryChanged);
|
||||
Settings.valueChanged.disconnect(onSettingsValueChanged);
|
||||
HMD.displayModeChanged.disconnect(onDisplayModeChanged);
|
||||
|
|
Loading…
Reference in a new issue