[vlc-commits] qml: better mainplayer controlbar alignment & navigation

Fatih Uzunoglu git at videolan.org
Mon Nov 16 10:04:15 CET 2020


vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Fri Aug 14 17:30:12 2020 +0300| [1909698cdf3eb517fab8560eaf2d1167ffe48380] | committer: Pierre Lamot

qml: better mainplayer controlbar alignment & navigation

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

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

 modules/gui/qt/player/qml/ControlBar.qml | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt/player/qml/ControlBar.qml b/modules/gui/qt/player/qml/ControlBar.qml
index ec12f97ce2..fc0080544e 100644
--- a/modules/gui/qt/player/qml/ControlBar.qml
+++ b/modules/gui/qt/player/qml/ControlBar.qml
@@ -84,14 +84,15 @@ Widgets.NavigableFocusScope {
             Layout.alignment: Qt.AlignLeft | Qt.AlignTop
             Layout.fillWidth: true
             enabled: player.playingState == PlayerController.PLAYING_STATE_PLAYING || player.playingState == PlayerController.PLAYING_STATE_PAUSED
-            Keys.onDownPressed: buttons.focus = true
+            Keys.onDownPressed: buttons_left.focus = true
 
             parentWindow: mainInterfaceRect
         }
 
-        RowLayout {
+        Item {
             Layout.fillWidth: true
             Layout.bottomMargin: VLCStyle.margin_xsmall
+            Layout.preferredHeight: Math.max(buttons_left.implicitHeight, buttons_center.implicitHeight, buttons_right.implicitHeight)
 
             PlayerButtonsLayout {
                 id: buttons_left
@@ -101,6 +102,10 @@ Widgets.NavigableFocusScope {
 
                 focus: true
 
+                anchors.left: parent.left
+
+                visible: model.count > 0 && (playerControlBarModel_center.count > 0 ? ((x+width) < buttons_center.x) : true)
+
                 navigationParent: root
                 navigationUp: function(index) {
                     if (trackPositionSlider.enabled)
@@ -109,14 +114,12 @@ Widgets.NavigableFocusScope {
                         root.navigationUp(index)
                 }
 
+                navigationRightItem: buttons_center
+
                 Keys.priority: Keys.AfterItem
                 Keys.onPressed: defaultKeyAction(event, 0)
             }
 
-            Item {
-                Layout.fillWidth: true
-            }
-
             PlayerButtonsLayout {
                 id: buttons_center
 
@@ -125,6 +128,8 @@ Widgets.NavigableFocusScope {
 
                 focus: true
 
+                anchors.horizontalCenter: parent.horizontalCenter
+
                 navigationParent: root
                 navigationUp: function(index) {
                     if (trackPositionSlider.enabled)
@@ -133,6 +138,8 @@ Widgets.NavigableFocusScope {
                         root.navigationUp(index)
                 }
 
+                navigationLeftItem: buttons_left
+                navigationRightItem: buttons_right
 
                 Keys.priority: Keys.AfterItem
                 Keys.onPressed: defaultKeyAction(event, 0)
@@ -150,6 +157,11 @@ Widgets.NavigableFocusScope {
 
                 focus: true
 
+                anchors.right: parent.right
+
+                visible: model.count > 0 && (playerControlBarModel_center.count > 0 ? ((buttons_center.x + buttons_center.width) < x)
+                                                                              : !(((buttons_left.x + buttons_left.width) > x) && playerControlBarModel_left.count > 0))
+
                 navigationParent: root
                 navigationUp: function(index) {
                     if (trackPositionSlider.enabled)
@@ -158,6 +170,8 @@ Widgets.NavigableFocusScope {
                         root.navigationUp(index)
                 }
 
+                navigationLeftItem: buttons_center
+
                 Keys.priority: Keys.AfterItem
                 Keys.onPressed: defaultKeyAction(event, 0)
             }



More information about the vlc-commits mailing list