]> git.sesse.net Git - vlc/commitdiff
Qt: space the toolbar items depending on the DPI
authorJarrad Whitaker <jarrad.whitaker@gmail.com>
Thu, 8 Jan 2015 00:54:47 +0000 (01:54 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 8 Jan 2015 01:46:17 +0000 (02:46 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/components/controller.cpp

index f11c9f6626995322a8840984640c0f81c2334d8e..07758b198c321b458d2edb6170d3e83fb127ad65 100644 (file)
@@ -167,14 +167,15 @@ void AbstractController::createAndAddWidget( QBoxLayout *controlLayout_,
         buttonGroupLayout = NULL;
     }
 
+    qreal scalingFactorX = static_cast<qreal>(logicalDpiX())/DPI_REF_VALUE;
     /* Special case for SPACERS, who aren't QWidgets */
     if( i_type == WIDGET_SPACER )
     {
-        controlLayout_->addSpacing( 12 );
+        controlLayout_->addSpacing( static_cast<int>(12*scalingFactorX) );
     }
     else if(  i_type == WIDGET_SPACER_EXTEND )
     {
-        controlLayout_->addStretch( 12 );
+        controlLayout_->addStretch( static_cast<int>(12*scalingFactorX) );
     }
     else
     {