Changed clang format to new agreement

This commit is contained in:
Jeremy Borgman
2020-09-23 20:39:30 -05:00
committed by borgmanJeremy
parent 2cbccc3d0a
commit 0d5386edd4
167 changed files with 8567 additions and 9081 deletions

View File

@@ -29,86 +29,79 @@ LoadSpinner::LoadSpinner(QWidget* parent)
, m_span(0)
, m_growing(true)
{
setAttribute(Qt::WA_TranslucentBackground);
const int size = QApplication::fontMetrics().height() * 8;
setFixedSize(size, size);
updateFrame();
// init timer
m_timer = new QTimer(this);
connect(m_timer, &QTimer::timeout, this, &LoadSpinner::rotate);
m_timer->setInterval(30);
setAttribute(Qt::WA_TranslucentBackground);
const int size = QApplication::fontMetrics().height() * 8;
setFixedSize(size, size);
updateFrame();
// init timer
m_timer = new QTimer(this);
connect(m_timer, &QTimer::timeout, this, &LoadSpinner::rotate);
m_timer->setInterval(30);
}
void
LoadSpinner::setColor(const QColor& c)
void LoadSpinner::setColor(const QColor& c)
{
m_color = c;
m_color = c;
}
void
LoadSpinner::setWidth(int w)
void LoadSpinner::setWidth(int w)
{
setFixedSize(w, w);
updateFrame();
setFixedSize(w, w);
updateFrame();
}
void
LoadSpinner::setHeight(int h)
void LoadSpinner::setHeight(int h)
{
setFixedSize(h, h);
updateFrame();
setFixedSize(h, h);
updateFrame();
}
void
LoadSpinner::start()
void LoadSpinner::start()
{
m_timer->start();
m_timer->start();
}
void
LoadSpinner::stop()
void LoadSpinner::stop()
{
m_timer->stop();
m_timer->stop();
}
void
LoadSpinner::paintEvent(QPaintEvent*)
void LoadSpinner::paintEvent(QPaintEvent*)
{
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing, true);
auto pen = QPen(m_color);
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing, true);
auto pen = QPen(m_color);
pen.setWidth(height() / 10);
painter.setPen(pen);
painter.setOpacity(0.2);
painter.drawArc(m_frame, 0, 5760);
painter.setOpacity(1.0);
painter.drawArc(m_frame, (m_startAngle * 16), (m_span * 16));
pen.setWidth(height() / 10);
painter.setPen(pen);
painter.setOpacity(0.2);
painter.drawArc(m_frame, 0, 5760);
painter.setOpacity(1.0);
painter.drawArc(m_frame, (m_startAngle * 16), (m_span * 16));
}
void
LoadSpinner::rotate()
void LoadSpinner::rotate()
{
const int advance = 3;
const int grow = 8;
if (m_growing) {
m_startAngle = (m_startAngle + advance) % 360;
m_span += grow;
if (m_span > 260) {
m_growing = false;
const int advance = 3;
const int grow = 8;
if (m_growing) {
m_startAngle = (m_startAngle + advance) % 360;
m_span += grow;
if (m_span > 260) {
m_growing = false;
}
} else {
m_startAngle = (m_startAngle + grow) % 360;
m_span = m_span + advance - grow;
if (m_span < 10) {
m_growing = true;
}
}
} else {
m_startAngle = (m_startAngle + grow) % 360;
m_span = m_span + advance - grow;
if (m_span < 10) {
m_growing = true;
}
}
update();
update();
}
void
LoadSpinner::updateFrame()
void LoadSpinner::updateFrame()
{
m_frame = QRect(OFFSET, OFFSET, width() - OFFSET * 2, height() - OFFSET * 2);
m_frame =
QRect(OFFSET, OFFSET, width() - OFFSET * 2, height() - OFFSET * 2);
}