2024-02-22 16:16:47 +01:00
import QtQuick 2.15
import QtQuick . Controls 2.15
import QtQuick . Layouts 1.15
2020-05-12 07:24:08 +10:00
import Qt . labs . platform 1.1
2024-02-22 16:16:47 +01:00
import Qt . labs . settings 1.1
import QtQuick . Window 2.15
import QtQml 2.15
import QtQuick . Controls . Universal 2.15
2020-07-12 12:47:46 -04:00
2021-10-28 00:27:49 +03:00
import utils 1.0
import shared 1.0
import shared . panels 1.0
import shared . popups 1.0
2024-07-19 14:15:50 +02:00
import shared . stores 1.0
2021-10-28 00:27:49 +03:00
2022-03-04 00:50:53 +02:00
import mainui 1.0
2025-01-21 15:29:05 -05:00
import AppLayouts . stores 1.0 as AppStores
2022-03-08 13:49:33 -05:00
import AppLayouts . Onboarding 1.0
2025-01-21 15:29:05 -05:00
import AppLayouts . Onboarding2 1.0 as Onboarding2
import AppLayouts . Onboarding2 . stores 1.0
2020-05-12 07:24:08 +10:00
2024-10-10 14:34:03 +02:00
import StatusQ 0.1
2022-12-12 12:11:10 +02:00
import StatusQ . Core . Theme 0.1
2021-05-19 17:03:14 +03:00
StatusWindow {
2024-07-19 14:15:50 +02:00
id: applicationWindow
2022-01-27 16:29:17 +01:00
property bool appIsReady: false
2020-06-23 16:49:04 -04:00
2025-01-21 15:29:05 -05:00
readonly property AppStores . FeatureFlagsStore featureFlagsStore: AppStores . FeatureFlagsStore {
readonly property var featureFlags: typeof featureFlagsRootContextProperty !== undefined ? featureFlagsRootContextProperty : null
connectorEnabled: featureFlags ? featureFlags.connectorEnabled : false
dappsEnabled: featureFlags ? featureFlags.dappsEnabled : false
swapEnabled: featureFlags ? featureFlags.swapEnabled : false
sendViaPersonalChatEnabled: featureFlags ? featureFlags.sendViaPersonalChatEnabled : false
paymentRequestEnabled: featureFlags ? featureFlags.paymentRequestEnabled : false
simpleSendEnabled: featureFlags ? featureFlags.simpleSendEnabled : false
// TODO get rid of direct access when the new login is available
// We need this to make sure the module is loaded before we can use it
onboardingV2Enabled: featureFlags && featureFlags . onboardingV2Enabled && typeof onboardingModule !== "undefined"
}
2024-07-19 14:15:50 +02:00
property MetricsStore metricsStore: MetricsStore { }
2024-10-22 00:01:34 +02:00
property UtilsStore utilsStore: UtilsStore { }
2024-07-19 14:15:50 +02:00
feat: Support system dark mode theme
Supports system dark mode. Changes the user appearance setting to a 3-way setting of System, Light, Dark.
New accounts will have their appearance setting set to "System", which uses the system setting to determine if dark mode should be applied.
Breaking change: Users who had their settings on Light Theme, will now get the system theme (light or dark). Users who had their theme set to Dark, will now get the Light theme.
At startup, the onboarding screens will have the system-level setting of dark mode applied or not. Once, logged in, the user settings will be applied.
## Note
An appearance setting of "System" is not dynamic to the system-level setting. This means that if a user has "System" set for their appearance (and ie, the user has light mode set), and then user then changes their system setting from light to dark, the app will not respond until it is restarted. This is due to a limitation of Qt not having a reliable way to propagate these changes to QML.
2020-09-29 16:18:00 +10:00
Universal.theme: Universal . System
2021-08-12 13:52:04 +02:00
objectName: "mainWindow"
2024-05-13 19:56:26 +02:00
minimumWidth: 1200
minimumHeight: 680
2024-10-15 21:26:12 +02:00
color: Theme . palette . background
2020-06-23 16:49:04 -04:00
title: {
// Set application settings
2022-07-19 14:12:29 +02:00
Qt . application . name = "Status Desktop"
Qt . application . displayName = qsTr ( "Status Desktop" )
2020-06-23 16:49:04 -04:00
Qt . application . organization = "Status"
Qt . application . domain = "status.im"
2022-10-27 13:17:08 +02:00
Qt . application . version = aboutModule . getCurrentVersion ( )
2022-07-19 14:12:29 +02:00
return Qt . application . displayName
2020-06-23 16:49:04 -04:00
}
2020-05-12 07:24:08 +10:00
visible: true
2020-05-18 11:07:30 -04:00
2022-05-16 09:57:51 +03:00
function restoreAppState ( ) {
let geometry = localAppSettings . geometry ;
let visibility = localAppSettings . visibility ;
if ( visibility !== Window . Windowed &&
visibility !== Window . Maximized &&
visibility !== Window . FullScreen ) {
visibility = Window . Windowed ;
}
2022-12-20 14:17:07 -05:00
if ( geometry === undefined ||
// If the monitor setup of the user changed, it's possible that the old geometry now falls out of the monitor range
// In this case, we reset to the basic geometry
geometry . x > Screen . desktopAvailableWidth ||
geometry . y > Screen . desktopAvailableHeight ||
geometry . width > Screen . desktopAvailableWidth ||
2024-07-03 10:51:15 +02:00
geometry . height > Screen . desktopAvailableHeight ||
geometry . x < 0 || geometry . y < 0 )
2022-12-20 14:17:07 -05:00
{
2022-05-16 09:57:51 +03:00
let screen = Qt . application . screens [ 0 ] ;
geometry = Qt . rect ( 0 ,
0 ,
Math . min ( Screen . desktopAvailableWidth - 125 , 1400 ) ,
Math . min ( Screen . desktopAvailableHeight - 125 , 840 ) ) ;
geometry . x = ( screen . width - geometry . width ) / 2 ;
geometry . y = ( screen . height - geometry . height ) / 2 ;
}
applicationWindow . visibility = visibility ;
2022-07-19 14:15:00 +02:00
if ( visibility === Window . Windowed ) {
2022-05-16 09:57:51 +03:00
applicationWindow . x = geometry . x ;
applicationWindow . y = geometry . y ;
2023-03-14 12:59:51 +02:00
applicationWindow . width = Math . max ( geometry . width , applicationWindow . minimumWidth )
applicationWindow . height = Math . max ( geometry . height , applicationWindow . minimumHeight )
2022-05-16 09:57:51 +03:00
}
2021-11-26 13:58:15 +01:00
}
2022-05-16 09:57:51 +03:00
function storeAppState ( ) {
if ( ! applicationWindow . appIsReady )
return ;
localAppSettings . visibility = applicationWindow . visibility ;
2022-07-19 14:15:00 +02:00
if ( applicationWindow . visibility === Window . Windowed ) {
2022-05-16 09:57:51 +03:00
localAppSettings . geometry = Qt . rect ( applicationWindow . x , applicationWindow . y ,
applicationWindow . width , applicationWindow . height ) ;
}
2021-11-26 13:58:15 +01:00
}
2022-05-16 09:57:51 +03:00
onXChanged: Qt . callLater ( storeAppState )
onYChanged: Qt . callLater ( storeAppState )
onWidthChanged: Qt . callLater ( storeAppState )
onHeightChanged: Qt . callLater ( storeAppState )
2021-11-26 13:58:15 +01:00
2023-08-02 16:49:28 +03:00
QtObject {
id: d
property int previousApplicationState: - 1
2023-09-25 13:23:25 +02:00
property var mockedKeycardControllerWindow
function runMockedKeycardControllerWindow ( ) {
2024-07-11 18:54:01 +02:00
if ( localAppSettings . displayMockedKeycardWindow ( ) ) {
2023-09-25 13:23:25 +02:00
if ( ! ! d . mockedKeycardControllerWindow ) {
d . mockedKeycardControllerWindow . close ( )
}
console . info ( "running mocked keycard lib controller window" )
var c = Qt . createComponent ( "qrc:/imports/shared/panels/MockedKeycardLibControllerWindow.qml" ) ;
if ( c . status === Component . Ready ) {
d . mockedKeycardControllerWindow = c . createObject ( applicationWindow , {
2025-01-21 15:29:05 -05:00
"relatedModule" : startupOnboardingLoader . item . visible ?
2023-09-25 13:23:25 +02:00
startupModule :
mainModule
} )
if ( d . mockedKeycardControllerWindow ) {
d . mockedKeycardControllerWindow . show ( )
d . mockedKeycardControllerWindow . requestActivate ( )
}
}
}
}
2023-08-02 16:49:28 +03:00
}
2020-11-17 14:07:01 +11:00
Action {
shortcut: StandardKey . FullScreen
2024-05-10 03:12:51 +02:00
onTriggered: applicationWindow . toggleFullScreen ( )
2020-11-17 14:07:01 +11:00
}
Action {
shortcut: "Ctrl+M"
2024-05-10 03:12:51 +02:00
onTriggered: applicationWindow . toggleMinimize ( )
2020-11-17 14:07:01 +11:00
}
2021-09-21 10:29:33 -05:00
2021-01-28 23:00:33 -04:00
Action {
2024-05-10 03:12:51 +02:00
shortcut: StandardKey . Close
2021-02-22 13:26:24 -04:00
onTriggered: {
applicationWindow . visible = false ;
}
}
Action {
2024-05-10 03:12:51 +02:00
shortcut: StandardKey . Quit
2021-01-28 23:00:33 -04:00
onTriggered: {
Qt . quit ( )
}
}
2022-12-14 16:40:50 +02:00
//TODO remove direct backend access
2022-11-29 14:18:39 -05:00
Connections {
id: windowsOsNotificationsConnection
2022-12-09 13:17:40 +03:00
enabled: Qt . platform . os === Constants . windows
2022-12-19 16:33:48 -05:00
target: Qt . platform . os === Constants . windows && typeof mainModule !== "undefined" ? mainModule : null
2022-11-29 14:18:39 -05:00
function onDisplayWindowsOsNotification ( title , message ) {
systemTray . showMessage ( title , message )
}
}
2025-01-21 15:29:05 -05:00
function moveToAppMain ( ) {
Global . appIsReady = true
loader . sourceComponent = app
if ( localAccountSensitiveSettings . recentEmojis === "" ) {
localAccountSensitiveSettings . recentEmojis = [ ] ;
}
if ( localAccountSensitiveSettings . hiddenCommunityWelcomeBanners === "" ) {
localAccountSensitiveSettings . hiddenCommunityWelcomeBanners = [ ] ;
}
if ( localAccountSensitiveSettings . hiddenCommunityBackUpBanners === "" ) {
localAccountSensitiveSettings . hiddenCommunityBackUpBanners = [ ] ;
}
startupOnboardingLoader . item . unload ( )
startupOnboardingLoader . active = false
onboardingStoreLoader . active = false
Theme . changeTheme ( localAppSettings . theme , systemPalette . isCurrentSystemThemeDark ( ) )
Theme . changeFontSize ( localAccountSensitiveSettings . fontSize )
d . runMockedKeycardControllerWindow ( )
}
2022-12-14 16:40:50 +02:00
//TODO remove direct backend access
2021-10-16 21:03:01 +02:00
Connections {
2025-01-21 15:29:05 -05:00
enabled: ! featureFlagsStore . onboardingV2Enabled
target: ! featureFlagsStore . onboardingV2Enabled ? startupModule : null
2022-01-27 16:29:17 +01:00
2022-07-19 14:15:00 +02:00
function onStartUpUIRaised ( ) {
2022-05-16 09:57:51 +03:00
applicationWindow . appIsReady = true ;
applicationWindow . storeAppState ( ) ;
2023-09-25 13:23:25 +02:00
d . runMockedKeycardControllerWindow ( )
2022-01-27 16:29:17 +01:00
}
2022-07-19 14:15:00 +02:00
function onAppStateChanged ( state ) {
2022-08-05 10:52:29 +02:00
if ( state === Constants . appState . startup ) {
// we're here only in case of error when we're returning from the app loading state
loader . sourceComponent = undefined
2023-05-04 18:18:19 +02:00
appLoadingAnimation . active = false
2025-01-21 15:29:05 -05:00
startupOnboardingLoader . item . visible = true
2022-08-05 10:52:29 +02:00
}
else if ( state === Constants . appState . appLoading ) {
2023-02-15 10:27:18 +02:00
loader . sourceComponent = undefined
2023-06-13 23:26:55 +03:00
appLoadingAnimation . active = false
2023-02-15 10:27:18 +02:00
appLoadingAnimation . active = true
2025-01-21 15:29:05 -05:00
startupOnboardingLoader . item . visible = false
2022-08-01 16:39:05 +02:00
}
else if ( state === Constants . appState . main ) {
2022-01-12 00:16:17 +01:00
// We set main module to the Global singleton once user is logged in and we move to the main app.
2023-02-15 10:27:18 +02:00
appLoadingAnimation . active = localAppSettings && localAppSettings . fakeLoadingScreenEnabled
appLoadingAnimation . runningProgressAnimation = localAppSettings && localAppSettings . fakeLoadingScreenEnabled
2023-11-21 13:26:26 -05:00
if ( ! appLoadingAnimation . runningProgressAnimation ) {
mainModule . fakeLoadingScreenFinished ( )
}
2025-01-21 15:29:05 -05:00
moveToAppMain ( )
2023-04-02 13:19:38 +02:00
} else if ( state === Constants . appState . appEncryptionProcess ) {
2023-03-29 16:26:11 +03:00
loader . sourceComponent = undefined
appLoadingAnimation . active = true
appLoadingAnimation . item . splashScreenText = qsTr ( "Database re-encryption in progress. Please do NOT close the app.\nThis may take up to 30 minutes. Sorry for the inconvenience.\n\n This process is a one time thing and is necessary for the proper functioning of the application." )
2025-01-21 15:29:05 -05:00
startupOnboardingLoader . item . visible = false
2021-11-24 14:30:00 +01:00
}
2021-10-16 21:03:01 +02:00
}
}
2021-05-19 17:03:14 +03:00
//! Workaround for custom QQuickWindow
Connections {
2021-06-03 11:29:14 +03:00
target: applicationWindow
2022-07-19 14:15:00 +02:00
function onClosing ( close ) {
2023-03-01 22:36:47 +01:00
if ( Qt . platform . os === Constants . mac ) {
2021-11-17 15:27:19 -05:00
loader . sourceComponent = undefined
close . accepted = true
} else {
2022-03-25 12:54:27 +03:00
if ( loader . sourceComponent != app ) {
2021-11-17 15:27:19 -05:00
Qt . quit ( ) ;
}
else if ( loader . sourceComponent == app ) {
if ( localAccountSensitiveSettings . quitOnClose ) {
Qt . quit ( ) ;
} else {
applicationWindow . visible = false ;
}
}
}
2021-05-19 17:03:14 +03:00
}
2021-01-28 23:00:33 -04:00
}
2021-09-21 10:29:33 -05:00
2023-08-02 16:49:28 +03:00
// On MacOS, explicitely restore the window on activating
Connections {
target: Qt . application
enabled: Qt . platform . os === Constants . mac
function onStateChanged ( ) {
if ( Qt . application . state == d . previousApplicationState
&& Qt . application . state == Qt . ApplicationActive ) {
2024-05-10 03:12:51 +02:00
makeStatusAppActive ( )
2023-08-02 16:49:28 +03:00
}
d . previousApplicationState = Qt . application . state
}
}
2022-12-14 16:40:50 +02:00
//TODO remove direct backend access
2024-05-10 03:12:51 +02:00
Connections {
2022-07-04 23:14:13 +02:00
target: singleInstance
2021-09-06 16:37:00 +03:00
2022-07-19 14:15:00 +02:00
function onSecondInstanceDetected ( ) {
2021-09-06 16:37:00 +03:00
console . log ( "User attempted to run the second instance of the application" )
// activating this instance to give user visual feedback
2024-05-10 03:12:51 +02:00
makeStatusAppActive ( )
2021-09-06 16:37:00 +03:00
}
}
2021-01-28 23:00:33 -04:00
2021-08-12 13:52:04 +02:00
// The easiest way to get current system theme (is it light or dark) without using
// OS native methods is to check lightness (0 - 1.0) of the window color.
// If it's too high (0.85+) means light theme is an active.
SystemPalette {
id: systemPalette
function isCurrentSystemThemeDark ( ) {
return window . hslLightness < 0.85
}
}
function changeThemeFromOutside ( ) {
2025-01-21 15:29:05 -05:00
Theme . changeTheme ( startupOnboardingLoader . item . visible ? Universal.System : localAppSettings . theme ,
2022-08-30 18:23:21 +03:00
systemPalette . isCurrentSystemThemeDark ( ) )
2021-08-12 13:52:04 +02:00
}
2020-07-12 12:47:46 -04:00
Component.onCompleted: {
2024-10-15 21:26:12 +02:00
Theme . changeTheme ( Universal . System , systemPalette . isCurrentSystemThemeDark ( ) ) ;
2022-02-03 15:42:22 -05:00
2022-05-16 09:57:51 +03:00
restoreAppState ( ) ;
2024-07-19 14:15:50 +02:00
Global . openMetricsEnablePopupRequested . connect ( openMetricsEnablePopup )
2024-08-19 12:52:17 -04:00
Global . addCentralizedMetricIfEnabled . connect ( metricsStore . addCentralizedMetricIfEnabled )
2020-07-12 12:47:46 -04:00
}
2020-06-04 17:38:24 +10:00
signal navigateTo ( string path )
2021-09-21 10:29:33 -05:00
2021-08-18 16:43:59 +02:00
function makeStatusAppActive ( ) {
2024-05-10 03:12:51 +02:00
applicationWindow . restoreWindowState ( )
applicationWindow . visible = true
2021-08-18 16:43:59 +02:00
applicationWindow . raise ( )
applicationWindow . requestActivate ( )
}
2024-08-08 16:53:49 -04:00
function openMetricsEnablePopup ( placement , cb = null ) {
2024-07-19 14:15:50 +02:00
metricsPopupLoader . active = true
metricsPopupLoader . item . visible = true
2024-08-08 16:53:49 -04:00
metricsPopupLoader . item . placement = placement
2024-07-19 14:15:50 +02:00
if ( cb )
cb ( metricsPopupLoader . item )
if ( ! localAppSettings . metricsPopupSeen ) {
localAppSettings . metricsPopupSeen = true
}
}
2024-05-15 16:55:54 +03:00
StatusTrayIcon {
2020-12-07 12:37:39 -05:00
id: systemTray
2024-05-15 16:55:54 +03:00
objectName: "systemTray"
isProduction: production
2024-07-12 09:41:27 -04:00
showRedDot: typeof mainModule !== "undefined" ? mainModule.notificationAvailable : false
2024-05-15 16:55:54 +03:00
onActivateApp: {
applicationWindow . makeStatusAppActive ( )
2020-05-18 11:07:30 -04:00
}
}
2020-06-04 17:38:24 +10:00
Loader {
id: loader
2020-05-18 11:07:30 -04:00
anchors.fill: parent
2022-10-18 11:06:18 +02:00
asynchronous: true
2022-03-04 00:50:53 +02:00
opacity: active ? 1.0 : 0.0
visible: ( opacity > 0.0001 )
Behavior on opacity { NumberAnimation { duration: 120 } }
2020-05-19 23:22:38 +10:00
}
2020-05-18 11:07:30 -04:00
2020-06-04 17:38:24 +10:00
Component {
2020-05-19 23:22:38 +10:00
id: app
2021-12-09 14:28:02 +01:00
AppMain {
2024-10-22 00:01:34 +02:00
utilsStore: applicationWindow . utilsStore
2025-01-21 15:29:05 -05:00
featureFlagsStore: applicationWindow . featureFlagsStore
2024-10-22 00:01:34 +02:00
2021-12-09 14:28:02 +01:00
sysPalette: systemPalette
2023-06-14 22:06:13 +03:00
visible: ! appLoadingAnimation . active
2024-07-19 14:15:50 +02:00
isCentralizedMetricsEnabled: metricsStore . isCentralizedMetricsEnabled
2021-12-09 14:28:02 +01:00
}
2020-06-04 17:38:24 +10:00
}
2023-02-15 10:27:18 +02:00
Loader {
2022-08-01 16:39:05 +02:00
id: appLoadingAnimation
2023-11-14 11:19:58 +03:00
objectName: "loadingAnimationLoader"
2023-02-15 10:27:18 +02:00
property bool runningProgressAnimation: false
anchors.fill: parent
active: false
sourceComponent: DidYouKnowSplashScreen {
2022-09-29 16:30:25 +02:00
objectName: "splashScreen"
2023-02-15 10:27:18 +02:00
NumberAnimation on progress { from: 0.0 ; to: 1 ; duration: 30000 ; running: runningProgressAnimation }
onProgressChanged: {
if ( progress === 1 ) {
appLoadingAnimation . active = false
2023-11-21 13:26:26 -05:00
mainModule . fakeLoadingScreenFinished ( )
2023-02-15 10:27:18 +02:00
}
}
2022-08-01 16:39:05 +02:00
}
2024-07-19 14:15:50 +02:00
onActiveChanged: {
if ( ! active ) {
// animation is finished, app main will be shown
// open metrics popup only if it has not been seen
if ( ! localAppSettings . metricsPopupSeen ) {
2024-08-08 16:53:49 -04:00
openMetricsEnablePopup ( Constants . metricsEnablePlacement . startApp , null )
2024-07-19 14:15:50 +02:00
}
}
}
2022-08-01 16:39:05 +02:00
}
2025-01-21 15:29:05 -05:00
Component {
id: splashScreenV2
DidYouKnowSplashScreen {
readonly property string pageClassName: "Splash"
property bool runningProgressAnimation
NumberAnimation on progress {
from: 0.0
to: 1
// TODO find a way to unhardcode this
// Though there is no easy way to do it, because we do not get progress signals
duration: 3000
running: runningProgressAnimation
}
}
}
Loader {
id: onboardingStoreLoader
active: featureFlagsStore . onboardingV2Enabled
sourceComponent: OnboardingStore {
onAppLoaded: moveToAppMain ( )
}
}
Loader {
id: startupOnboardingLoader
2022-07-20 14:34:44 +02:00
anchors.fill: parent
2025-01-21 15:29:05 -05:00
sourceComponent: {
if ( featureFlagsStore . onboardingV2Enabled ) {
// TODO select a new component when we have the new login screens (for old users)
return onboardingV2
}
return onboardingV1
}
}
Component {
id: onboardingV1
OnboardingLayout {
objectName: "startupOnboardingLayout"
anchors.fill: parent
utilsStore: applicationWindow . utilsStore
}
}
Component {
id: onboardingV2
Onboarding2 . OnboardingLayout {
objectName: "startupOnboardingLayout"
anchors.fill: parent
2025-01-23 12:03:36 -05:00
// TODO implement those two
loginAccountsModel: ListModel { }
isBiometricsLogin: false
2025-01-21 15:29:05 -05:00
networkChecksEnabled: true
biometricsAvailable: Qt . platform . os === Constants . mac
2024-10-22 00:01:34 +02:00
2025-01-21 15:29:05 -05:00
onboardingStore: onboardingStoreLoader . item
onFinished: ( flow , data ) = > {
console . warn ( "!!! ONBOARDING FINISHED; flow:" , flow , "; data:" , JSON . stringify ( data ) )
let error = onboardingStoreLoader . item . finishOnboardingFlow ( flow , data )
if ( error != "" ) {
console . error ( "!!! ONBOARDING FINISHED WITH ERROR:" , error )
// TODO show error
return
}
console . warn ( "!!! Onboarding completed!" )
stack . clear ( )
stack . push ( splashScreenV2 , { runningProgressAnimation: true } )
}
2025-01-10 15:17:16 -05:00
onShareUsageDataRequested: {
applicationWindow . metricsStore . toggleCentralizedMetrics ( enabled )
if ( enabled ) {
Global . addCentralizedMetricIfEnabled ( "usage_data_shared" , { placement: Constants . metricsEnablePlacement . onboarding } )
}
}
onCurrentPageNameChanged: Global . addCentralizedMetricIfEnabled ( "navigation" , { viewId: currentPageName } )
2025-01-21 15:29:05 -05:00
}
2020-05-12 07:24:08 +10:00
}
2020-07-10 17:47:31 -04:00
2024-07-19 14:15:50 +02:00
Loader {
id: metricsPopupLoader
active: false
sourceComponent: MetricsEnablePopup {
visible: true
onClosed: metricsPopupLoader . active = false
2024-08-20 17:51:18 +02:00
onSetMetricsEnabledRequested: {
2024-08-08 16:53:49 -04:00
applicationWindow . metricsStore . toggleCentralizedMetrics ( enabled )
2024-08-19 12:52:17 -04:00
if ( enabled ) {
Global . addCentralizedMetricIfEnabled ( "usage_data_shared" , { placement: metricsPopupLoader . item . placement } )
2024-08-08 16:53:49 -04:00
}
}
2024-07-19 14:15:50 +02:00
}
}
2023-03-01 22:36:47 +01:00
MacTrafficLights { // FIXME should be a direct part of StatusAppNavBar
2021-05-19 21:31:18 +03:00
anchors.left: parent . left
anchors.top: parent . top
anchors.margins: 13
2024-05-10 03:12:51 +02:00
visible: Qt . platform . os === Constants . mac && applicationWindow . visibility !== Window . FullScreen
2021-06-03 11:29:14 +03:00
onClose: {
2022-03-25 12:54:27 +03:00
if ( loader . sourceComponent != app ) {
2023-08-02 16:49:28 +03:00
Qt . quit ( )
return
2021-06-03 11:29:14 +03:00
}
2023-09-25 13:23:25 +02:00
2023-08-02 16:49:28 +03:00
if ( localAccountSensitiveSettings . quitOnClose ) {
Qt . quit ( ) ;
return
2023-09-25 13:23:25 +02:00
}
2023-08-02 16:49:28 +03:00
applicationWindow . visible = false ;
2021-06-03 11:29:14 +03:00
}
onMinimised: {
2024-05-10 03:12:51 +02:00
applicationWindow . toggleMinimize ( )
2021-06-03 11:29:14 +03:00
}
onMaximized: {
applicationWindow . toggleFullScreen ( )
}
2021-05-19 21:31:18 +03:00
}
2020-05-12 07:24:08 +10:00
}