From 89d67ca33fcd1dd19278d248007d8aef4097407b Mon Sep 17 00:00:00 2001 From: J-P Nurmi <jpnurmi@theqtcompany.com> Date: Thu, 30 Oct 2014 15:29:32 +0100 Subject: [PATCH] Layouts: increase the default spacing on mobile platforms Change-Id: I7aff0236a08465c05559bd8a2e8a60b556fbc4ba Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> --- src/layouts/qquicklayoutstyleinfo.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/layouts/qquicklayoutstyleinfo.cpp b/src/layouts/qquicklayoutstyleinfo.cpp index 1b9f2f577..144b14f00 100644 --- a/src/layouts/qquicklayoutstyleinfo.cpp +++ b/src/layouts/qquicklayoutstyleinfo.cpp @@ -44,11 +44,18 @@ QQuickLayoutStyleInfo::QQuickLayoutStyleInfo() qreal QQuickLayoutStyleInfo::spacing(Qt::Orientation /*orientation*/) const { +#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) || defined(Q_OS_BLACKBERRY) || defined(Q_OS_QNX) || defined(Q_OS_WINRT) + // On Android and iOS the default spacing between each UI element is 8dp + qreal spacing = 8.0; +#else qreal spacing = 5.0; -#ifndef Q_OS_MAC - // On mac the DPI is always 72 so we should not scale it +#endif + +#ifndef Q_OS_OSX + // On OS X the DPI is always 72 so we should not scale it spacing = qRound(spacing * (qreal(qt_defaultDpiX()) / 96.0)); #endif + return spacing; } -- GitLab