[vlc-devel] [PATCH] qml: don't instanciate floating playlist window when unnecessary
Pierre Lamot
pierre at videolabs.io
Wed Jul 10 11:02:45 CEST 2019
Windows are still instanciated with their content when visible is false
---
modules/gui/qt/qml/MainInterface.qml | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/modules/gui/qt/qml/MainInterface.qml b/modules/gui/qt/qml/MainInterface.qml
index e898d9a5d3..ac828cff63 100644
--- a/modules/gui/qt/qml/MainInterface.qml
+++ b/modules/gui/qt/qml/MainInterface.qml
@@ -34,16 +34,19 @@ Rectangle {
id: root
color: "transparent"
- Window {
- id: playlistWindow
- visible: !rootWindow.playlistDocked && rootWindow.playlistVisible
- title: qsTr("Playlist")
- color: VLCStyle.colors.bg
- onClosing: rootWindow.playlistVisible = false
- PL.PlaylistListView {
- id: playlistView
- focus: true
- anchors.fill: parent
+ Loader {
+ id: playlistWindowLoader
+ active: !rootWindow.playlistDocked && rootWindow.playlistVisible
+ sourceComponent: Window {
+ visible: true
+ title: qsTr("Playlist")
+ color: VLCStyle.colors.bg
+ onClosing: rootWindow.playlistVisible = false
+ PL.PlaylistListView {
+ id: playlistView
+ focus: true
+ anchors.fill: parent
+ }
}
}
--
2.17.1
More information about the vlc-devel
mailing list