From a130681dd5ceed3faebf014f1278c4d8ed8b876e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tinkl?= Date: Tue, 19 Jul 2022 14:15:00 +0200 Subject: [PATCH] chore(@main): unbreak minimize/fullscreen shortcuts those need proper context (plus some warnings fixed) --- ui/main.qml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/ui/main.qml b/ui/main.qml index cbae35afb1..73cac0fc9f 100644 --- a/ui/main.qml +++ b/ui/main.qml @@ -5,7 +5,6 @@ import Qt.labs.platform 1.1 import Qt.labs.settings 1.0 import QtQuick.Window 2.12 import QtQml 2.13 -import QtQuick.Window 2.0 import QtQuick.Controls.Universal 2.12 import DotherSide 0.1 @@ -61,7 +60,7 @@ StatusWindow { } applicationWindow.visibility = visibility; - if (visibility == Window.Windowed) { + if (visibility === Window.Windowed) { applicationWindow.x = geometry.x; applicationWindow.y = geometry.y; applicationWindow.width = geometry.width; @@ -74,7 +73,7 @@ StatusWindow { return; localAppSettings.visibility = applicationWindow.visibility; - if (applicationWindow.visibility == Window.Windowed) { + if (applicationWindow.visibility === Window.Windowed) { localAppSettings.geometry = Qt.rect(applicationWindow.x, applicationWindow.y, applicationWindow.width, applicationWindow.height); } @@ -88,7 +87,7 @@ StatusWindow { Action { shortcut: StandardKey.FullScreen onTriggered: { - if (visibility === Window.FullScreen) { + if (applicationWindow.visibility === Window.FullScreen) { showNormal() } else { showFullScreen() @@ -99,7 +98,7 @@ StatusWindow { Action { shortcut: "Ctrl+M" onTriggered: { - if (visibility === Window.Minimized) { + if (applicationWindow.visibility === Window.Minimized) { showNormal() } else { showMinimized() @@ -126,12 +125,12 @@ StatusWindow { Connections { target: startupModule - onStartUpUIRaised: { + function onStartUpUIRaised() { applicationWindow.appIsReady = true; applicationWindow.storeAppState(); } - onAppStateChanged: { + function onAppStateChanged(state) { if(state === Constants.appState.main) { // We set main module to the Global singleton once user is logged in and we move to the main app. Global.mainModuleInst = mainModule @@ -155,7 +154,7 @@ StatusWindow { //! Workaround for custom QQuickWindow Connections { target: applicationWindow - onClosing: { + function onClosing(close) { if (Qt.platform.os === "osx") { loader.sourceComponent = undefined close.accepted = true @@ -177,7 +176,7 @@ StatusWindow { Connections { target: singleInstance - onSecondInstanceDetected: { + function onSecondInstanceDetected() { console.log("User attempted to run the second instance of the application") // activating this instance to give user visual feedback applicationWindow.show() @@ -185,7 +184,7 @@ StatusWindow { applicationWindow.requestActivate() } - onEventReceived: { + function onEventReceived(eventStr) { let event = JSON.parse(eventStr) if (event.hasOwnProperty("uri")) { // Not Refactored Yet