From 70ad96e6207551ba0f40e4501e3d2d38ea325385 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 28 Feb 2018 21:40:29 +0100 Subject: 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 --- src/imports/controls/material/qquickmaterialbusyindicator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 #include #include #include @@ -124,7 +125,7 @@ void QQuickMaterialBusyIndicatorNode::updateCurrentTime(int time) QPen pen; QSGImageNode *textureNode = static_cast(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); -- cgit v1.2.3