[vlc-commits] [Git][videolan/vlc][master] 4 commits: qml: load playlist overlay menu only when docked

Jean-Baptiste Kempf gitlab at videolan.org
Sun Jun 13 12:52:45 UTC 2021



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
9c30462c by Fatih Uzunoglu at 2021-06-13T12:39:40+00:00
qml: load playlist overlay menu only when docked

fixes #25737.

- - - - -
c4abfa0d by Fatih Uzunoglu at 2021-06-13T12:39:40+00:00
qml: define default geometry for detached playlist window

- - - - -
f0937bdf by Fatih Uzunoglu at 2021-06-13T12:39:40+00:00
qml: override 'g_root' in detached playlist window

- - - - -
9d97156e by Fatih Uzunoglu at 2021-06-13T12:39:40+00:00
qml: resolve DragItem parent properly in detached playlist window

- - - - -


3 changed files:

- modules/gui/qt/playlist/qml/PlaylistDelegate.qml
- modules/gui/qt/playlist/qml/PlaylistDetachedWindow.qml
- modules/gui/qt/playlist/qml/PlaylistListView.qml


Changes:

=====================================
modules/gui/qt/playlist/qml/PlaylistDelegate.qml
=====================================
@@ -77,7 +77,7 @@ Rectangle {
             plInfoTooltip.timeout = 2000
         else
             plInfoTooltip.timeout = 0
-        plInfoTooltip.visible = Qt.binding(function() { return ( (selectAction ? selected : hovered) && !overlayMenu.visible && mainInterface.playlistVisible &&
+        plInfoTooltip.visible = Qt.binding(function() { return ( (selectAction ? selected : hovered) && !overlayMenu.shown && mainInterface.playlistVisible &&
                                                                 (textInfo.implicitWidth > textInfo.width || textArtist.implicitWidth > textArtist.width)); })
     }
 


=====================================
modules/gui/qt/playlist/qml/PlaylistDetachedWindow.qml
=====================================
@@ -25,11 +25,29 @@ import "qrc:///style/"
 
 Window {
     visible: true
+
+    property var rootWindow: g_root
+    readonly property point rootLocation: rootWindow.mapToGlobal(rootWindow.x, rootWindow.y)
+
+    width: 300
+    minimumWidth: playlistView.minimumWidth
+    // minimumHeight: mainInterface.minimumHeight
     title: i18n.qtr("Playlist")
     color: VLCStyle.colors.bg
+
+    Component.onCompleted: {
+        minimumHeight = mainInterface.minimumHeight // suppress non-notifyable property binding
+
+        x = rootLocation.x + rootWindow.width + VLCStyle.dp(10, VLCStyle.scale)
+        y = rootLocation.y
+        height = rootWindow.height
+    }
+
     PlaylistListView {
         id: playlistView
         focus: true
         anchors.fill: parent
+
+        readonly property var g_root: playlistView
     }
 }


=====================================
modules/gui/qt/playlist/qml/PlaylistListView.qml
=====================================
@@ -81,13 +81,24 @@ Widgets.NavigableFocusScope {
         listView.forceActiveFocus();
     }
 
-    PlaylistOverlayMenu {
+    Loader {
         id: overlayMenu
         anchors.fill: parent
         z: 1
 
-        colors: root.colors
-        backgroundItem: parentRect
+        active: mainInterface.playlistDocked
+
+        readonly property bool shown: (status === Loader.Ready) ? item.visible : false
+
+        function open() {
+            if (status === Loader.Ready)
+                item.open()
+        }
+
+        sourceComponent: PlaylistOverlayMenu {
+            colors: root.colors
+            backgroundItem: parentRect
+        }
     }
 
     Rectangle {
@@ -103,6 +114,8 @@ Widgets.NavigableFocusScope {
         Widgets.DragItem {
             id: dragItem
 
+            parent: (typeof g_mainDisplay !== 'undefined') ? g_mainDisplay : root
+
             property int index: -1
 
             colors: root.colors



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7c295ee33d52e23e3741f50f7bc9e8ae36b622bb...9d97156e8572431eda459a3e1809c757f79ac96a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7c295ee33d52e23e3741f50f7bc9e8ae36b622bb...9d97156e8572431eda459a3e1809c757f79ac96a
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list