[vlc-commits] qt/pref: fix toolbar icon or text beeing cropped on Hi-DPI displays

Pierre Lamot git at videolan.org
Fri Oct 13 00:57:13 CEST 2017


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed Sep 13 11:45:26 2017 +0200| [32930aa2e0c72371d4865a1ef18a0bab460be40a] | committer: Jean-Baptiste Kempf

qt/pref: fix toolbar icon or text beeing cropped on Hi-DPI displays

Qt doesn't seems to handle properly when QIcon within QToolButton doesn't
 respect the original image ratio.

 This might results in icons beeing cropped on Linux or text beeing cropped
 on windows.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt/components/simple_preferences.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/components/simple_preferences.cpp b/modules/gui/qt/components/simple_preferences.cpp
index 9ae0b6ad6e..ca458dd17a 100644
--- a/modules/gui/qt/components/simple_preferences.cpp
+++ b/modules/gui/qt/components/simple_preferences.cpp
@@ -198,7 +198,8 @@ SPrefsCatList::SPrefsCatList( intf_thread_t *_p_intf, QWidget *_parent ) :
     button->setText( label );                                               \
     button->setToolTip( ltooltip );                                         \
     button->setToolButtonStyle( Qt::ToolButtonTextUnderIcon );              \
-    button->setIconSize( QSize( icon_height + 40 , icon_height ) );         \
+    button->setIconSize( QSize( icon_height, icon_height ) );               \
+    button->setMinimumSize( QSize( icon_height + 40, icon_height + 40 ) );  \
     button->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); \
     button->setAutoRaise( true );                                           \
     button->setCheckable( true );                                           \



More information about the vlc-commits mailing list