fix: close window instead of app

This commit is contained in:
B.Melnik 2021-06-03 11:29:14 +03:00 committed by Iuri Matias
parent 4a407d9204
commit b9c2431ad5
2 changed files with 31 additions and 9 deletions

View File

@ -89,7 +89,7 @@ StatusWindow {
//! Workaround for custom QQuickWindow
Connections {
target: c
target: applicationWindow
onClosing: {
if (loader.sourceComponent == login) {
applicationWindow.visible = false;
@ -411,12 +411,34 @@ StatusWindow {
}
MacTrafficLights {
parent: Overlay.overlay
// parent: Overlay.overlay
anchors.left: parent.left
anchors.top: parent.top
anchors.margins: 13
visible: Qt.platform.os === "osx" && !applicationWindow.isFullScreen
onClose: {
if (loader.sourceComponent == login ||
loader.sourceComponent == intro) {
applicationWindow.visible = false;
}
else if (loader.sourceComponent == app) {
if (loader.item.appSettings.quitOnClose) {
Qt.quit();
} else {
applicationWindow.visible = false;
}
}
}
onMinimised: {
applicationWindow.showMinimized()
}
onMaximized: {
applicationWindow.toggleFullScreen()
}
}
}

View File

@ -5,6 +5,10 @@ import "../imports"
MouseArea {
id: statusMacWindowButtons
signal close()
signal minimised()
signal maximized()
hoverEnabled: true
width: layout.implicitWidth
@ -15,10 +19,6 @@ MouseArea {
readonly property color inactiveBorder: Style.current.name === Constants.lightThemeName ? "#10000000"
: "#10FFFFFF"
Row {
id: layout
spacing: 8
@ -48,7 +48,7 @@ MouseArea {
id: closeSensor
anchors.fill: parent
onClicked: applicationWindow.close()
onClicked: statusMacWindowButtons.close()
}
}
@ -77,7 +77,7 @@ MouseArea {
id: miniSensor
anchors.fill: parent
onClicked: applicationWindow.showMinimized()
onClicked: statusMacWindowButtons.minimised()
}
}
@ -105,7 +105,7 @@ MouseArea {
id: maxiSensor
anchors.fill: parent
onClicked: applicationWindow.toggleFullScreen()
onClicked: statusMacWindowButtons.maximized()
}
}
}