Apply the main window visibility property only at startup

Otherwise it can affect the state of the window when showing again streaming
This commit is contained in:
Cameron Gutman 2024-04-14 13:35:41 -05:00
parent d1ccd19fcc
commit afbc49e39a

View file

@ -19,26 +19,30 @@ ApplicationWindow {
property bool clearOnBack: false property bool clearOnBack: false
id: window id: window
visible: true
width: 1280 width: 1280
height: 600 height: 600
// Override the background color to Material 2 colors for Qt 6.5+
// in order to improve contrast between GFE's placeholder box art
// and the background of the app grid.
Component.onCompleted: { Component.onCompleted: {
// Override the background color to Material 2 colors for Qt 6.5+
// in order to improve contrast between GFE's placeholder box art
// and the background of the app grid.
if (SystemProperties.usesMaterial3Theme) { if (SystemProperties.usesMaterial3Theme) {
Material.background = "#303030" Material.background = "#303030"
} }
}
visibility: { // Show the window according to the user's preferences
if (SystemProperties.hasDesktopEnvironment) { if (SystemProperties.hasDesktopEnvironment) {
if (StreamingPreferences.uiDisplayMode == StreamingPreferences.UI_WINDOWED) return "Windowed" if (StreamingPreferences.uiDisplayMode == StreamingPreferences.UI_MAXIMIZED) {
else if (StreamingPreferences.uiDisplayMode == StreamingPreferences.UI_MAXIMIZED) return "Maximized" window.showMaximized()
else if (StreamingPreferences.uiDisplayMode == StreamingPreferences.UI_FULLSCREEN) return "FullScreen" }
else if (StreamingPreferences.uiDisplayMode == StreamingPreferences.UI_FULLSCREEN) {
window.showFullScreen()
}
else {
window.show()
}
} else { } else {
return "FullScreen" window.showFullScreen()
} }
} }