[vlc-commits] [Git][videolan/vlc][master] 3 commits: qml/TopBar: Add the 'textWidth' property

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Mon Jun 20 17:35:43 UTC 2022



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
7f9ba8b8 by Benjamin Arnaud at 2022-06-20T17:18:08+00:00
qml/TopBar: Add the 'textWidth' property

- - - - -
bf0317dd by Pierre Lamot at 2022-06-20T17:18:08+00:00
qml/TopBar: Add the 'reservedHeight' property

- - - - -
9383a3e8 by Benjamin Arnaud at 2022-06-20T17:18:08+00:00
qml/Player: Adjust PlaylistListView placement and size

fix #26670

Co-authored-by: Pierre Lamot <pierre at videolabs.io>

- - - - -


2 changed files:

- modules/gui/qt/player/qml/Player.qml
- modules/gui/qt/player/qml/TopBar.qml


Changes:

=====================================
modules/gui/qt/player/qml/Player.qml
=====================================
@@ -370,6 +370,8 @@ FocusScope {
         component: FocusScope {
             readonly property bool isResumeDialogVisible: resumeDialog.visible
 
+            property alias topbar: topbar
+
             width: topcontrolView.width
             height: topbar.implicitHeight
             focus: true
@@ -378,6 +380,10 @@ FocusScope {
                 id: topbar
 
                 anchors.fill: parent
+
+                textWidth: (MainCtx.playlistVisible) ? rootPlayer.width - playlistpopup.width
+                                                     : rootPlayer.width
+
                 focus: true
                 visible: !resumeDialog.visible
                 title: mainPlaylistController.currentItem.title
@@ -607,20 +613,28 @@ FocusScope {
         property bool showPlaylist: false
 
         anchors {
-            top: parent.top
+            // NOTE: When the controls are pinned we display the playqueue under the topBar.
+            top: (rootPlayer.pinVideoControls) ? topcontrolView.bottom
+                                               : parent.top
             right: parent.right
             bottom: parent.bottom
-            bottomMargin: parent.height - rootPlayer.positionSliderY
+
             topMargin: VLCStyle.applicationVerticalMargin
+            bottomMargin: parent.height - rootPlayer.positionSliderY
         }
+
         focus: false
         edge: Widgets.DrawerExt.Edges.Right
         state: playlistVisibility.isPlaylistVisible ? "visible" : "hidden"
         component: Rectangle {
-            color: rootPlayer.colors.setColorAlpha(rootPlayer.colors.topBanner, 0.8)
-            width: (rootPlayer.width + playlistView.rightPadding) / 4
+            // NOTE: Take the minimumWidth into account.
+            width: Math.max(playlistView.minimumWidth,
+                            (rootPlayer.width + playlistView.rightPadding) / 4)
+
             height: playlistpopup.height
 
+            color: rootPlayer.colors.setColorAlpha(rootPlayer.colors.topBanner, 0.8)
+
             PL.PlaylistListView {
                 id: playlistView
 
@@ -631,6 +645,14 @@ FocusScope {
                 colors: rootPlayer.colors
                 rightPadding: VLCStyle.applicationHorizontalMargin
 
+                topPadding:  {
+                    if (rootPlayer.pinVideoControls)
+                        return VLCStyle.margin_normal
+                    else
+                        // NOTE: We increase the padding accordingly to avoid overlapping the TopBar.
+                        return topcontrolView.contentItem.topbar.reservedHeight
+                }
+
                 Navigation.parentItem: rootPlayer
                 Navigation.upItem: topcontrolView
                 Navigation.downItem: controlBarView


=====================================
modules/gui/qt/player/qml/TopBar.qml
=====================================
@@ -35,11 +35,15 @@ FocusScope{
         Vertical
     }
 
+    /* required */ property int textWidth
+
     property string title
     property VLCColors colors: VLCStyle.nightColors
     property int groupAlignment: TopBar.GroupAlignment.Vertical
     property Item _currentTitleText: null
 
+    property alias reservedHeight: rightColumn.height
+
     signal togglePlaylistVisibility()
     signal requestLockUnlockAutoHide(bool lock, var source)
 
@@ -211,6 +215,9 @@ FocusScope{
 
         //FIXME use the the right class
         T.Label {
+            Layout.fillWidth: true
+            Layout.maximumWidth: topFocusScope.textWidth - VLCStyle.margin_normal
+
             text: topFocusScope.title
             horizontalAlignment: Text.AlignLeft
             topPadding: VLCStyle.margin_large
@@ -219,8 +226,6 @@ FocusScope{
             font.weight: Font.DemiBold
             font.pixelSize: VLCStyle.dp(18, VLCStyle.scale)
             elide: Text.ElideRight
-
-            Layout.fillWidth: true
         }
     }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d695e4facfc2ba13497731eda48e24ef7b7403b1...9383a3e8767c2334840131a03c2bb53bd339adaa

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d695e4facfc2ba13497731eda48e24ef7b7403b1...9383a3e8767c2334840131a03c2bb53bd339adaa
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list