3#include "qml_material/path/measured_path.hpp"
5#include <QtCore/QSizeF>
9struct ProgressSegment {
14 qreal trackGapSize = -1;
17struct ProgressIndicatorState {
18 bool circular =
false;
19 bool indeterminate =
false;
21 bool mirrored =
false;
22 bool legacyRadius =
false;
23 bool legacyCenter =
false;
24 bool legacySegments =
false;
27 qreal amplitudeFraction = 1;
29 qreal startAngle = -90;
30 qreal strokeWidth = 4;
31 qreal waveLength = 40;
32 qreal waveAmplitude = 3;
39 bool stopVisible =
true;
40 std::vector<ProgressSegment> segments;
42 bool explicitTrack =
false;
47struct ProgressDrawPath {
50 qreal strokeWidth = 0;
53class QML_MATERIAL_API ProgressIndicatorGeometry {
55 static QPointF lineBounds(qreal start, qreal end, qreal gap, qreal stroke, qreal width);
57 const std::vector<ProgressDrawPath>& render(
const ProgressIndicatorState& state, QSizeF size);
58 quint64 cacheRevision()
const {
return m_revision; }
61 void rebuild(
const ProgressIndicatorState& state, QSizeF size);
63 bool m_circular =
false;
65 bool m_legacyRadius =
false;
66 bool m_legacyCenter =
false;
68 qreal m_wavelength = -1;
69 qreal m_amplitude = -1;
71 qreal m_actualWavelength = 0;
74 MeasuredPath m_circle;
75 quint64 m_revision = 0;
76 std::vector<ProgressDrawPath> m_result;