mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-01-09 09:48:43 +00:00
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:
parent
d1ccd19fcc
commit
afbc49e39a
1 changed files with 14 additions and 10 deletions
|
@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue