[vlc-commits] [Git][videolan/vlc][master] qml: correct disappearing control spacing

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Sat Apr 30 12:04:31 UTC 2022



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


Commits:
92577c17 by Fatih Uzunoglu at 2022-04-30T11:45:03+00:00
qml: correct disappearing control spacing

- - - - -


2 changed files:

- modules/gui/qt/player/qml/ControlLayout.qml
- modules/gui/qt/player/qml/PlayerControlLayout.qml


Changes:

=====================================
modules/gui/qt/player/qml/ControlLayout.qml
=====================================
@@ -83,7 +83,7 @@ FocusScope {
 
         anchors.fill: parent
 
-        spacing: 0
+        spacing: playerControlLayout.spacing
 
         Item {
             Layout.fillWidth: rightAligned
@@ -113,17 +113,6 @@ FocusScope {
                 Layout.minimumWidth: minimumWidth
                 Layout.fillWidth: expandable
                 Layout.maximumWidth: item.implicitWidth
-                // This is a workaround of not using RowLayout's built-in `spacing`
-                // RowLayout adds an unwanted spacing at the end of the layout so
-                // this is used instead.
-                Layout.rightMargin: {
-                    for (var i = index + 1; i < repeater.count; ++i) {
-                        var item = repeater.itemAt(i)
-                        if (!!item && item.visible)
-                            return playerControlLayout.spacing
-                    }
-                    return 0
-                }
 
                 readonly property real minimumWidth: (expandable ? item.minimumWidth : item.implicitWidth)
                 readonly property bool expandable: (item.minimumWidth !== undefined)


=====================================
modules/gui/qt/player/qml/PlayerControlLayout.qml
=====================================
@@ -59,7 +59,8 @@ FocusScope {
             top: parent.top
             bottom: parent.bottom
 
-            rightMargin: layoutSpacing
+            // Spacing for the filler item acts as padding
+            rightMargin: layoutSpacing - spacing
         }
 
         active: !!playerControlLayout.model
@@ -124,7 +125,8 @@ FocusScope {
             top: parent.top
             bottom: parent.bottom
 
-            leftMargin: layoutSpacing
+            // Spacing for the filler item acts as padding
+            leftMargin: layoutSpacing - spacing
         }
 
         active: !!playerControlLayout.model



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/92577c1755f98930255497772d65e909b628d57e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/92577c1755f98930255497772d65e909b628d57e
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