[vlc-commits] qml: fix ButtonsLayout IconToolButton scaling issue

Fatih Uzunoglu git at videolan.org
Mon Dec 7 10:08:37 UTC 2020


vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Fri Dec  4 02:01:54 2020 +0300| [644dbc25687f8b73cf955bb330d8e4a731c3a291] | committer: Pierre Lamot

qml: fix ButtonsLayout IconToolButton scaling issue

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

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

 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



More information about the vlc-commits mailing list