diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2014-10-30 15:29:32 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2014-10-30 16:50:01 +0100 |
commit | 89d67ca33fcd1dd19278d248007d8aef4097407b (patch) | |
tree | dc73eec91a10acd0c5eee93da1e33743a6ad0d3e | |
parent | 41e66ea6daa47d940365a458e7a12977bb32c690 (diff) |
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>
-rw-r--r-- | src/layouts/qquicklayoutstyleinfo.cpp | 11 |
1 files 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; } |