[vlc-devel] [PATCH 03/10] qt: fix toolbar icon or text beeing cropped on Hi-DPI displays

Pierre Lamot pierre at videolabs.io
Fri Sep 29 10:25:05 CEST 2017


 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.
---
 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..c697e1dc94 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->setMinimumWidth( icon_height + 40 );                            \
     button->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); \
     button->setAutoRaise( true );                                           \
     button->setCheckable( true );                                           \
-- 
2.14.1



More information about the vlc-devel mailing list