[vlc-commits] Qt: space the toolbar items depending on the DPI

Jarrad Whitaker git at videolan.org
Thu Jan 8 02:46:25 CET 2015


vlc | branch: master | Jarrad Whitaker <jarrad.whitaker at gmail.com> | Thu Jan  8 01:54:47 2015 +0100| [34a7c0c760a155424b550bef2fb824431b46f523] | committer: Jean-Baptiste Kempf

Qt: space the toolbar items depending on the DPI

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

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

 modules/gui/qt4/components/controller.cpp |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
index f11c9f6..07758b1 100644
--- a/modules/gui/qt4/components/controller.cpp
+++ b/modules/gui/qt4/components/controller.cpp
@@ -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
     {



More information about the vlc-commits mailing list