forked from Silverfish/proton-bridge
GODT-1329: Dark mode, with macOS autodetect.
This commit is contained in:
@ -20,6 +20,7 @@ import QtQuick 2.13
|
||||
import QtQuick.Window 2.13
|
||||
import Qt.labs.platform 1.1
|
||||
|
||||
import Proton 4.0
|
||||
import Notifications 1.0
|
||||
|
||||
QtObject {
|
||||
@ -58,6 +59,7 @@ QtObject {
|
||||
onCacheUnavailable: {
|
||||
mainWindow.showAndRise()
|
||||
}
|
||||
onColorSchemeNameChanged: root.setColorScheme()
|
||||
}
|
||||
}
|
||||
|
||||
@ -206,15 +208,15 @@ QtObject {
|
||||
|
||||
switch (reason) {
|
||||
case SystemTrayIcon.Unknown:
|
||||
break;
|
||||
break;
|
||||
case SystemTrayIcon.Context:
|
||||
case SystemTrayIcon.Trigger:
|
||||
case SystemTrayIcon.DoubleClick:
|
||||
case SystemTrayIcon.MiddleClick:
|
||||
calcStatusWindowPosition()
|
||||
toggleWindow(statusWindow)
|
||||
calcStatusWindowPosition()
|
||||
toggleWindow(statusWindow)
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -225,6 +227,9 @@ QtObject {
|
||||
console.log("backend not loaded")
|
||||
}
|
||||
|
||||
root.setColorScheme()
|
||||
|
||||
|
||||
if (!root.backend.users) {
|
||||
console.log("users not loaded")
|
||||
}
|
||||
@ -253,4 +258,9 @@ QtObject {
|
||||
|
||||
root.backend.guiReady()
|
||||
}
|
||||
|
||||
function setColorScheme() {
|
||||
if (root.backend.colorSchemeName == "light") ProtonStyle.currentStyle = ProtonStyle.lightStyle
|
||||
if (root.backend.colorSchemeName == "dark") ProtonStyle.currentStyle = ProtonStyle.darkStyle
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user