diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-02-28 21:40:29 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-03-01 07:29:52 +0000 |
commit | 70ad96e6207551ba0f40e4501e3d2d38ea325385 (patch) | |
tree | 278a54058689b812371fba3cb69b3a5969f075be | |
parent | cbf9d8076981d07ae9c9ee9323288b2c30a8b1e8 (diff) |
Material: calculate BusyIndicator's line width
A BusyIndicator with its default implicit size (48px) gets the same
line-width (4px) as before: 48px / 12 = 4px. The line-width is still
not adjustable as requested in QTBUG-64872, but tiny and huge busy
indicators look now much better.
Task-number: QTBUG-64872
Change-Id: If21feaf1f898b337eae879a961d37b54b217ed87
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | src/imports/controls/material/qquickmaterialbusyindicator.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/imports/controls/material/qquickmaterialbusyindicator.cpp b/src/imports/controls/material/qquickmaterialbusyindicator.cpp index bd15390b..0a4191be 100644 --- a/src/imports/controls/material/qquickmaterialbusyindicator.cpp +++ b/src/imports/controls/material/qquickmaterialbusyindicator.cpp @@ -36,6 +36,7 @@ #include "qquickmaterialbusyindicator_p.h" +#include <QtCore/qmath.h> #include <QtCore/qeasingcurve.h> #include <QtGui/qpainter.h> #include <QtQuick/qsgimagenode.h> @@ -124,7 +125,7 @@ void QQuickMaterialBusyIndicatorNode::updateCurrentTime(int time) QPen pen; QSGImageNode *textureNode = static_cast<QSGImageNode *>(firstChild()); pen.setColor(m_color); - pen.setWidth(4 * m_devicePixelRatio); + pen.setWidth(qCeil(size / 12) * m_devicePixelRatio); painter.setPen(pen); const qreal percentageComplete = time / qreal(RotationAnimationDuration); |