[libcalamaresui] Move to more modern-style initializations
This commit is contained in:
parent
1f7dd2fcd5
commit
78a8993f38
@ -70,19 +70,6 @@ WaitingSpinnerWidget::WaitingSpinnerWidget(Qt::WindowModality modality,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WaitingSpinnerWidget::initialize() {
|
void WaitingSpinnerWidget::initialize() {
|
||||||
_color = Qt::black;
|
|
||||||
_textColor = Qt::black;
|
|
||||||
_roundness = 100.0;
|
|
||||||
_minimumTrailOpacity = 3.14159265358979323846;
|
|
||||||
_trailFadePercentage = 80.0;
|
|
||||||
_revolutionsPerSecond = 1.57079632679489661923;
|
|
||||||
_numberOfLines = 20;
|
|
||||||
_lineLength = 10;
|
|
||||||
_lineWidth = 2;
|
|
||||||
_innerRadius = 10;
|
|
||||||
_currentCounter = 0;
|
|
||||||
_isSpinning = false;
|
|
||||||
|
|
||||||
_timer = new QTimer(this);
|
_timer = new QTimer(this);
|
||||||
connect(_timer, SIGNAL(timeout()), this, SLOT(rotate()));
|
connect(_timer, SIGNAL(timeout()), this, SLOT(rotate()));
|
||||||
updateSize();
|
updateSize();
|
||||||
|
@ -129,23 +129,32 @@ private:
|
|||||||
void updatePosition();
|
void updatePosition();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QColor _color;
|
// PI, leading to a full fade in one whole revolution
|
||||||
qreal _roundness; // 0..100
|
static constexpr const auto radian = 3.14159265358979323846;
|
||||||
qreal _minimumTrailOpacity;
|
|
||||||
qreal _trailFadePercentage;
|
// Spinner-wheel related settings
|
||||||
qreal _revolutionsPerSecond;
|
QColor _color = Qt::black;
|
||||||
int _numberOfLines;
|
qreal _roundness = 100.0; // 0..100
|
||||||
int _lineLength;
|
qreal _minimumTrailOpacity = radian;
|
||||||
int _lineWidth;
|
qreal _trailFadePercentage = 80.0;
|
||||||
int _innerRadius;
|
qreal _revolutionsPerSecond = radian / 2;
|
||||||
|
int _numberOfLines = 20;
|
||||||
|
int _lineLength = 10;
|
||||||
|
int _lineWidth = 2;
|
||||||
|
int _innerRadius = 10;
|
||||||
|
QSize _imageSize;
|
||||||
|
|
||||||
|
// Text-related settings
|
||||||
Qt::AlignmentFlag _alignment = Qt::AlignmentFlag::AlignBottom;
|
Qt::AlignmentFlag _alignment = Qt::AlignmentFlag::AlignBottom;
|
||||||
QString _text;
|
QString _text;
|
||||||
QSize _imageSize;
|
QColor _textColor = Qt::black;
|
||||||
QColor _textColor;
|
|
||||||
|
|
||||||
QTimer *_timer;
|
// Environment settings
|
||||||
bool _centerOnParent;
|
bool _centerOnParent;
|
||||||
bool _disableParentWhenSpinning;
|
bool _disableParentWhenSpinning;
|
||||||
int _currentCounter;
|
|
||||||
bool _isSpinning;
|
// Internal bits
|
||||||
|
QTimer *_timer = nullptr;
|
||||||
|
int _currentCounter = 0;
|
||||||
|
bool _isSpinning = false;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user