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

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -49,14 +49,26 @@ ProgressIndicator::ProgressIndicator(IndicatorSize size, QWidget *parent)
setIndicatorSize(size); 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) void ProgressIndicator::setIndicatorSize(ProgressIndicator::IndicatorSize size)
{ {
m_size = size; m_size = size;
m_rotationStep = size == Small ? 45 : 30; m_rotationStep = size == Small ? 45 : 30;
m_timer.setInterval(size == Small ? 100 : 80); m_timer.setInterval(size == Small ? 100 : 80);
m_pixmap.load(StyleHelper::dpiSpecificImageFile( m_pixmap.load(StyleHelper::dpiSpecificImageFile(
size == Small ? QLatin1String(":/utils/images/progressindicator_small.png") imageFileNameForIndicatorSize(size)));
: QLatin1String(":/utils/images/progressindicator_big.png")));
updateGeometry(); updateGeometry();
} }

View File

@@ -47,6 +47,7 @@ class QTCREATOR_UTILS_EXPORT ProgressIndicator : public QWidget
public: public:
enum IndicatorSize { enum IndicatorSize {
Small, Small,
Medium,
Large Large
}; };

View File

@@ -9,6 +9,8 @@
<file>images/crumblepath-segment-selected.png</file> <file>images/crumblepath-segment-selected.png</file>
<file>images/progressindicator_big.png</file> <file>images/progressindicator_big.png</file>
<file>images/progressindicator_big@2x.png</file> <file>images/progressindicator_big@2x.png</file>
<file>images/progressindicator_medium.png</file>
<file>images/progressindicator_medium@2x.png</file>
<file>images/progressindicator_small.png</file> <file>images/progressindicator_small.png</file>
<file>images/progressindicator_small@2x.png</file> <file>images/progressindicator_small@2x.png</file>
<file>images/triangle_vert.png</file> <file>images/triangle_vert.png</file>

View File

@@ -1134,6 +1134,127 @@
y="0" y="0"
x="0" /> x="0" />
</g> </g>
<g
transform="matrix(-0.5,0,0,0.5,589.5,300)"
clip-path="url(#clipPath3536)"
id="src/libs/utils/images/progressindicator_medium">
<g
id="g3383">
<rect
style="opacity:0.41699997;fill:none;stroke:none"
id="rect3385"
width="64"
height="64"
x="329"
y="536" />
<rect
y="536"
x="359"
height="18"
width="4"
id="rect3387"
style="fill:#6d6d6d;fill-opacity:1;stroke:none" />
</g>
<use
x="0"
y="0"
xlink:href="#g3383"
id="use3389"
transform="matrix(0.8660254,0.5,-0.5,0.8660254,332.36483,-104.40243)"
width="800"
height="600"
style="opacity:0.88700005" />
<use
x="0"
y="0"
xlink:href="#g3383"
id="use3391"
transform="matrix(0.5,0.8660254,-0.8660254,0.5,672.40243,-28.635171)"
width="800"
height="600"
style="opacity:0.77300002" />
<use
x="0"
y="0"
xlink:href="#g3383"
id="use3393"
transform="matrix(0,1,-1,0,929,207)"
width="800"
height="600"
style="opacity:0.66000001" />
<use
x="0"
y="0"
xlink:href="#g3383"
id="use3395"
transform="matrix(-0.5,0.8660254,-0.8660254,-0.5,1033.4024,539.36483)"
width="800"
height="600"
style="opacity:0.547" />
<use
x="0"
y="0"
xlink:href="#g3383"
id="use3397"
transform="matrix(-0.8660254,0.5,-0.5,-0.8660254,957.63514,879.40243)"
width="800"
height="600"
style="opacity:0.43299997" />
<use
x="0"
y="0"
xlink:href="#g3383"
id="use3399"
transform="matrix(-1,0,0,-1,721.99997,1136)"
width="800"
height="600"
style="opacity:0.31999996" />
<use
x="0"
y="0"
xlink:href="#g3383"
id="use3401"
transform="matrix(-0.8660254,-0.5,0.5,-0.8660254,389.63514,1240.4024)"
width="800"
height="600"
style="opacity:0.31999996" />
<use
x="0"
y="0"
xlink:href="#g3383"
id="use3403"
transform="matrix(-0.5,-0.8660254,0.8660254,-0.5,49.597541,1164.6351)"
width="800"
height="600"
style="opacity:0.31999996" />
<use
x="0"
y="0"
xlink:href="#g3383"
id="use3405"
transform="matrix(0,-1,1,0,-207.00003,928.99993)"
width="800"
height="600"
style="opacity:0.31999996" />
<use
x="0"
y="0"
xlink:href="#g3383"
id="use3407"
transform="matrix(0.5,-0.8660254,0.8660254,0.5,-311.40246,596.6351)"
width="800"
height="600"
style="opacity:0.31999996" />
<use
x="0"
y="0"
xlink:href="#g3383"
id="use3409"
transform="matrix(0.8660254,-0.5,0.5,0.8660254,-235.6352,256.5975)"
width="800"
height="600"
style="opacity:0.31999996" />
</g>
<g <g
id="src/libs/utils/images/progressindicator_big" id="src/libs/utils/images/progressindicator_big"
clip-path="url(#clipPath3536)" clip-path="url(#clipPath3536)"

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 76 KiB