[vlc-commits] qml: include PIP player in medialibrary views
Pierre Lamot
git at videolan.org
Mon Dec 7 12:31:54 UTC 2020
vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Fri Oct 16 10:05:57 2020 +0200| [0283c50c5fd705c163168c570a06a802be850dfd] | committer: Pierre Lamot
qml: include PIP player in medialibrary views
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0283c50c5fd705c163168c570a06a802be850dfd
---
modules/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 a0b8e5f130..a8abc20740 100644
--- a/modules/gui/qt/maininterface/qml/MainDisplay.qml
+++ b/modules/gui/qt/maininterface/qml/MainDisplay.qml
@@ -326,6 +326,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
@@ -335,7 +370,7 @@ Widgets.NavigableFocusScope {
anchors.right: parent.right
anchors.bottom: parent.bottom
- z: 2
+ z: 3
navigationParent: medialibId
navigationUpItem: stackView
navigationCancelItem:sourcesBanner
More information about the vlc-commits
mailing list