[vlc-commits] qml: remove redundant application margins in subcomponents of TopBar

Prince Gupta git at videolan.org
Mon Mar 15 10:33:10 UTC 2021


vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Wed Mar 10 20:30:40 2021 +0530| [08cb835197fd0a3acd6f2402ba42e6d70ebf6802] | committer: Pierre Lamot

qml: remove redundant application margins in subcomponents of TopBar

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

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

 modules/gui/qt/player/qml/Player.qml       | 5 ++++-
 modules/gui/qt/player/qml/ResumeDialog.qml | 6 ++----
 modules/gui/qt/player/qml/TopBar.qml       | 5 +----
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/modules/gui/qt/player/qml/Player.qml b/modules/gui/qt/player/qml/Player.qml
index 9035c5d62f..e7190fcd34 100644
--- a/modules/gui/qt/player/qml/Player.qml
+++ b/modules/gui/qt/player/qml/Player.qml
@@ -205,7 +205,7 @@ Widgets.NavigableFocusScope {
         component: rootPlayer.pinVideoControls ? backgroundForPinnedControls : topcontrolViewBackground
         onContentItemChanged: {
             if (rootPlayer.pinVideoControls)
-                contentItem.height = Qt.binding(function () { return topcontrolView.height; })
+                contentItem.height = Qt.binding(function () { return topcontrolView.height + topcontrolView.anchors.topMargin; })
         }
 
         Component {
@@ -287,6 +287,9 @@ Widgets.NavigableFocusScope {
             top: parent.top
             left: parent.left
             right: parent.right
+            topMargin: VLCStyle.applicationVerticalMargin
+            leftMargin: VLCStyle.applicationHorizontalMargin
+            rightMargin: VLCStyle.applicationHorizontalMargin
         }
 
         z: 1
diff --git a/modules/gui/qt/player/qml/ResumeDialog.qml b/modules/gui/qt/player/qml/ResumeDialog.qml
index db108ffbbd..07f73eb921 100644
--- a/modules/gui/qt/player/qml/ResumeDialog.qml
+++ b/modules/gui/qt/player/qml/ResumeDialog.qml
@@ -97,11 +97,9 @@ Widgets.NavigableFocusScope {
 
         RowLayout {
             id: layout
-            anchors.fill: parent
-            anchors.topMargin: VLCStyle.applicationVerticalMargin
-            anchors.leftMargin: VLCStyle.applicationHorizontalMargin + VLCStyle.margin_small
-            anchors.rightMargin: VLCStyle.applicationHorizontalMargin
 
+            anchors.fill: parent
+            anchors.leftMargin: VLCStyle.margin_small
             spacing: VLCStyle.margin_small
 
             Text {
diff --git a/modules/gui/qt/player/qml/TopBar.qml b/modules/gui/qt/player/qml/TopBar.qml
index b865f725b2..4aa53d15a8 100644
--- a/modules/gui/qt/player/qml/TopBar.qml
+++ b/modules/gui/qt/player/qml/TopBar.qml
@@ -84,10 +84,7 @@ Widgets.NavigableFocusScope{
 
         hoverEnabled: true
         anchors.fill: parent
-        anchors.topMargin: VLCStyle.applicationVerticalMargin
-        anchors.leftMargin: VLCStyle.applicationHorizontalMargin
-        anchors.rightMargin: VLCStyle.applicationHorizontalMargin
-        implicitHeight: rowLayout.implicitHeight + anchors.topMargin
+        implicitHeight: rowLayout.implicitHeight
 
         onContainsMouseChanged: topFocusScope.requestLockUnlockAutoHide(containsMouse, topFocusScope)
 



More information about the vlc-commits mailing list