mirror of https://code.videolan.org/videolan/vlc
qml: do not unload playlist window if not visible
This commit is contained in:
parent
62aaef36a8
commit
73bad34911
|
@ -136,7 +136,7 @@ Item {
|
|||
Loader {
|
||||
id: playlistWindowLoader
|
||||
asynchronous: true
|
||||
active: !MainCtx.playlistDocked && MainCtx.playlistVisible
|
||||
active: !MainCtx.playlistDocked
|
||||
source: "qrc:///playlist/PlaylistDetachedWindow.qml"
|
||||
}
|
||||
Connections {
|
||||
|
|
|
@ -25,10 +25,10 @@ import "qrc:///style/"
|
|||
|
||||
|
||||
Window {
|
||||
visible: true
|
||||
visible: MainCtx.playlistVisible
|
||||
|
||||
// TODO: Qt >5.13 use transientParent
|
||||
property QtWindow parentWindow: MainCtx.intfMainWindow
|
||||
property QtWindow parentWindow
|
||||
|
||||
width: 350
|
||||
minimumWidth: playlistView.minimumWidth
|
||||
|
@ -36,16 +36,19 @@ Window {
|
|||
title: qsTr("Playlist")
|
||||
color: theme.bg.primary
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!!parentWindow) {
|
||||
height = parentWindow.height
|
||||
minimumHeight = parentWindow.minimumHeight
|
||||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
const window = parentWindow ? parentWindow : MainCtx.intfMainWindow
|
||||
if (window) {
|
||||
height = window.height
|
||||
minimumHeight = window.minimumHeight
|
||||
|
||||
x = parentWindow.x + parentWindow.width + 10
|
||||
y = parentWindow.y
|
||||
} else {
|
||||
height = 400
|
||||
minimumHeight = 200
|
||||
x = window.x + window.width + 10
|
||||
y = window.y
|
||||
} else {
|
||||
height = 400
|
||||
minimumHeight = 200
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue