Utils: Add medium sized round indicator

Change-Id: I7f66f63a905e1a9abf7905816dbd86ec3a8951ed
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Alessandro Portale
2015-01-16 18:10:09 +01:00
committed by Eike Ziller
parent 21a5766cee
commit bc46e179cd
6 changed files with 138 additions and 2 deletions

View File

@@ -49,14 +49,26 @@ ProgressIndicator::ProgressIndicator(IndicatorSize size, QWidget *parent)
setIndicatorSize(size);
}
static QString imageFileNameForIndicatorSize(ProgressIndicator::IndicatorSize size)
{
switch (size) {
case ProgressIndicator::Large:
return QLatin1String(":/utils/images/progressindicator_big.png");
case ProgressIndicator::Medium:
return QLatin1String(":/utils/images/progressindicator_medium.png");
case ProgressIndicator::Small:
default:
return QLatin1String(":/utils/images/progressindicator_small.png");
}
}
void ProgressIndicator::setIndicatorSize(ProgressIndicator::IndicatorSize size)
{
m_size = size;
m_rotationStep = size == Small ? 45 : 30;
m_timer.setInterval(size == Small ? 100 : 80);
m_pixmap.load(StyleHelper::dpiSpecificImageFile(
size == Small ? QLatin1String(":/utils/images/progressindicator_small.png")
: QLatin1String(":/utils/images/progressindicator_big.png")));
imageFileNameForIndicatorSize(size)));
updateGeometry();
}