[vlc-commits] qml: make MiniPlayer layout-independent in MainDisplay

Fatih Uzunoglu git at videolan.org
Thu Aug 27 12:44:48 CEST 2020


vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Mon Aug  3 21:03:53 2020 +0300| [4c625722b5a3909fa9c9325b7994ca5c843b821e] | committer: Pierre Lamot

qml: make MiniPlayer layout-independent in MainDisplay

Signed-off-by: Pierre Lamot <pierre at videolabs.io>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4c625722b5a3909fa9c9325b7994ca5c843b821e
---

 modules/gui/qt/medialibrary/qml/MainDisplay.qml | 29 +++++++++++++++----------
 modules/gui/qt/player/qml/MiniPlayer.qml        |  9 ++++++--
 2 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/modules/gui/qt/medialibrary/qml/MainDisplay.qml b/modules/gui/qt/medialibrary/qml/MainDisplay.qml
index e61a2bfe51..c7e276de53 100644
--- a/modules/gui/qt/medialibrary/qml/MainDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MainDisplay.qml
@@ -211,10 +211,11 @@ Widgets.NavigableFocusScope {
                         anchors {
                             top: parent.top
                             right: parent.right
-                            bottom: parent.bottom
                         }
                         focus: false
 
+                        height: parent.height - miniPlayer.implicitHeight
+
                         property bool expanded: mainInterface.playlistDocked && mainInterface.playlistVisible
 
                         state: playlistColumn.expanded ? "expanded" : "collapsed"
@@ -352,20 +353,24 @@ Widgets.NavigableFocusScope {
                         }
                     }
                 }
+            }
 
-                Player.MiniPlayer {
-                    id: miniPlayer
-                    z: 2
-                    navigationParent: medialibId
-                    navigationUpItem: stackView
-                    navigationCancelItem:sourcesBanner
-                    onExpandedChanged: {
-                        if (!expanded && miniPlayer.activeFocus)
-                            stackView.forceActiveFocus()
-                    }
+            Player.MiniPlayer {
+                id: miniPlayer
+
+                anchors.left: parent.left
+                anchors.right: parent.right
+                anchors.bottom: parent.bottom
+
+                z: 2
+                navigationParent: medialibId
+                navigationUpItem: stackView
+                navigationCancelItem:sourcesBanner
+                onExpandedChanged: {
+                    if (!expanded && miniPlayer.activeFocus)
+                        stackView.forceActiveFocus()
                 }
             }
         }
-
     }
 }
diff --git a/modules/gui/qt/player/qml/MiniPlayer.qml b/modules/gui/qt/player/qml/MiniPlayer.qml
index ac2525d93b..c022f9a0a5 100644
--- a/modules/gui/qt/player/qml/MiniPlayer.qml
+++ b/modules/gui/qt/player/qml/MiniPlayer.qml
@@ -13,8 +13,6 @@ Widgets.NavigableFocusScope {
 
     id: root
 
-    Layout.fillWidth: true
-
     readonly property bool expanded: root.implicitHeight === root.childrenRect.height
 
     Component.onCompleted : {
@@ -52,6 +50,13 @@ Widgets.NavigableFocusScope {
         to: 0
     }
 
+    // this MouseArea prevents mouse events to be sent below miniplayer
+    MouseArea {
+        anchors.fill: parent
+        hoverEnabled: true
+        acceptedButtons: Qt.AllButtons
+    }
+
     Column {
         anchors.left: parent.left
         anchors.right: parent.right



More information about the vlc-commits mailing list