[vlc-devel] [PATCH 19/27] qml: fix ButtonsLayout IconToolButton scaling issue

Fatih Uzunoglu fuzun54 at outlook.com
Fri Dec 4 00:01:54 CET 2020


---
 modules/gui/qt/player/qml/ButtonsLayout.qml       | 2 +-
 modules/gui/qt/player/qml/PlayerButtonsLayout.qml | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/player/qml/ButtonsLayout.qml b/modules/gui/qt/player/qml/ButtonsLayout.qml
index b0f1f60690..d4a44b19de 100644
--- a/modules/gui/qt/player/qml/ButtonsLayout.qml
+++ b/modules/gui/qt/player/qml/ButtonsLayout.qml
@@ -93,7 +93,7 @@ Widgets.NavigableFocusScope {
                     buttonloader.item.focus = true
 
                     if (buttonloader.item instanceof Widgets.IconToolButton)
-                        buttonloader.item.size = buttonsLayout.defaultSize
+                        buttonloader.item.size = Qt.binding(function() { return buttonsLayout.defaultSize; })
 
                     //force buttons color
                     if (buttonsLayout.forceColors) {
diff --git a/modules/gui/qt/player/qml/PlayerButtonsLayout.qml b/modules/gui/qt/player/qml/PlayerButtonsLayout.qml
index 4c90b72dfd..6cfa1730fd 100644
--- a/modules/gui/qt/player/qml/PlayerButtonsLayout.qml
+++ b/modules/gui/qt/player/qml/PlayerButtonsLayout.qml
@@ -38,6 +38,8 @@ Widgets.NavigableFocusScope {
 
     property bool forceColors: false
 
+    property var defaultSize: VLCStyle.icon_normal // default size for IconToolButton based controls
+
     property real spacing: VLCStyle.margin_normal // spacing between controls
     property real layoutSpacing: VLCStyle.margin_xlarge // spacing between layouts (left, center, and right)
 
@@ -85,6 +87,8 @@ Widgets.NavigableFocusScope {
 
         forceColors: playerButtonsLayout.forceColors
         
+        defaultSize: playerButtonsLayout.defaultSize
+
         visible: extraWidth < 0 ? false : true // extraWidth < 0 means there is not even available space for minimumSize
 
         navigationParent: playerButtonsLayout
@@ -109,6 +113,8 @@ Widgets.NavigableFocusScope {
 
         forceColors: playerButtonsLayout.forceColors
 
+        defaultSize: playerButtonsLayout.defaultSize
+
         navigationParent: playerButtonsLayout
         navigationLeftItem: buttonrow_left
         navigationRightItem: buttonrow_right
@@ -135,6 +141,8 @@ Widgets.NavigableFocusScope {
 
         forceColors: playerButtonsLayout.forceColors
 
+        defaultSize: playerButtonsLayout.defaultSize
+
         visible: extraWidth < 0 ? false : true // extraWidth < 0 means there is not even available space for minimumSize
 
         navigationParent: playerButtonsLayout
-- 
2.27.0



More information about the vlc-devel mailing list