feat: use custom window without titlebar
This commit is contained in:
parent
97464a2303
commit
7b62dbbc33
26
ui/main.qml
26
ui/main.qml
|
@ -9,13 +9,15 @@ import QtQml 2.13
|
|||
import QtQuick.Window 2.0
|
||||
import QtQuick.Controls.Universal 2.12
|
||||
|
||||
import DotherSide 0.1
|
||||
|
||||
import "./onboarding"
|
||||
import "./app"
|
||||
import "./sounds"
|
||||
import "./shared"
|
||||
import "./imports"
|
||||
|
||||
ApplicationWindow {
|
||||
StatusWindow {
|
||||
property bool hasAccounts: !!loginModel.rowCount()
|
||||
property bool removeMnemonicAfterLogin: false
|
||||
property alias dragAndDrop: dragTarget
|
||||
|
@ -85,6 +87,9 @@ ApplicationWindow {
|
|||
}
|
||||
}
|
||||
|
||||
//! Workaround for custom QQuickWindow
|
||||
Connections {
|
||||
target: applicationWindow
|
||||
onClosing: {
|
||||
if (loader.sourceComponent == login) {
|
||||
applicationWindow.visible = false;
|
||||
|
@ -100,6 +105,16 @@ ApplicationWindow {
|
|||
}
|
||||
}
|
||||
|
||||
onActiveChanged: {
|
||||
if (active && currentlyHasANotification) {
|
||||
currentlyHasANotification = false
|
||||
// QML doesn't have a function to hide notifications, but this does the trick
|
||||
systemTray.hide()
|
||||
systemTray.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
Style.changeTheme(globalSettings.theme)
|
||||
setX(Qt.application.screens[0].width / 2 - width / 2);
|
||||
|
@ -110,15 +125,6 @@ ApplicationWindow {
|
|||
|
||||
property bool currentlyHasANotification: false
|
||||
|
||||
onActiveChanged: {
|
||||
if (active && currentlyHasANotification) {
|
||||
currentlyHasANotification = false
|
||||
// QML doesn't have a function to hide notifications, but this does the trick
|
||||
systemTray.hide()
|
||||
systemTray.show()
|
||||
}
|
||||
}
|
||||
|
||||
SystemTrayIcon {
|
||||
id: systemTray
|
||||
visible: true
|
||||
|
|
Loading…
Reference in New Issue