chore(@main): unbreak minimize/fullscreen shortcuts
those need proper context (plus some warnings fixed)
This commit is contained in:
parent
8c2b4ed89f
commit
a130681dd5
19
ui/main.qml
19
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
|
||||
|
|
Loading…
Reference in New Issue