[vlc-devel] [PATCH 08/14] qml: include PIP player in medialibrary views

Pierre Lamot pierre at videolabs.io
Thu Oct 22 15:14:20 CEST 2020


---
 .../gui/qt/maininterface/qml/MainDisplay.qml  | 37 ++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/maininterface/qml/MainDisplay.qml b/modules/gui/qt/maininterface/qml/MainDisplay.qml
index 8eb1cec624..db808eb2d6 100644
--- a/modules/gui/qt/maininterface/qml/MainDisplay.qml
+++ b/modules/gui/qt/maininterface/qml/MainDisplay.qml
@@ -332,6 +332,41 @@ Widgets.NavigableFocusScope {
                 }
             }
 
+            Player.PIPPlayer {
+                id: playerPip
+                anchors {
+                    bottom: miniPlayer.top
+                    left: parent.left
+                    bottomMargin: VLCStyle.margin_normal
+                    leftMargin: VLCStyle.margin_normal + VLCStyle.applicationHorizontalMargin
+                }
+
+                width: VLCStyle.dp(320, VLCStyle.scale)
+                height: VLCStyle.dp(180, VLCStyle.scale)
+                z: 2
+                visible: !root._inhibitMiniPlayer && mainInterface.hasEmbededVideo
+                enabled: !root._inhibitMiniPlayer && mainInterface.hasEmbededVideo
+
+                dragXMin: 0
+                dragXMax: root.width - playerPip.width
+                dragYMin: sourcesBanner.y + sourcesBanner.height
+                dragYMax: miniPlayer.y - playerPip.height
+
+                //keep the player visible on resize
+                Connections {
+                    target: root
+                    onWidthChanged: {
+                        if (playerPip.x > playerPip.dragXMax)
+                            playerPip.x = playerPip.dragXMax
+                    }
+                    onHeightChanged: {
+                        if (playerPip.y > playerPip.dragYMax)
+                            playerPip.y = playerPip.dragYMax
+                    }
+                }
+            }
+
+
             Player.MiniPlayer {
                 id: miniPlayer
 
@@ -341,7 +376,7 @@ Widgets.NavigableFocusScope {
                 anchors.right: parent.right
                 anchors.bottom: parent.bottom
 
-                z: 2
+                z: 3
                 navigationParent: medialibId
                 navigationUpItem: stackView
                 navigationCancelItem:sourcesBanner
-- 
2.25.1



More information about the vlc-devel mailing list