Utils: Make the progress indicator themable

Ensures a consistent visibility with light and dark backgrounds.

Change-Id: I8e825ccf05248abb2c94c4cd3af56d0226bc7e96
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Alessandro Portale
2017-06-06 18:01:39 +02:00
parent 0316219f8d
commit 646abdd445
8 changed files with 30 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 850 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 875 B

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 B

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 397 B

After

Width:  |  Height:  |  Size: 302 B

View File

@@ -25,6 +25,7 @@
#include "progressindicator.h" #include "progressindicator.h"
#include "icon.h"
#include "qtcassert.h" #include "qtcassert.h"
#include "stylehelper.h" #include "stylehelper.h"
@@ -62,8 +63,8 @@ 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 = Icon({{imageFileNameForIndicatorSize(size),
imageFileNameForIndicatorSize(size))); Theme::PanelTextColorMid}}, Icon::Tint).pixmap();
updateGeometry(); updateGeometry();
} }

View File

@@ -709,6 +709,14 @@
id="src/libs/utils/images/progressindicator_small" id="src/libs/utils/images/progressindicator_small"
clip-path="url(#clipPath4556)" clip-path="url(#clipPath4556)"
transform="matrix(-1,0,0,1,578,0)"> transform="matrix(-1,0,0,1,578,0)">
<rect
style="fill:#ffffff"
id="rect5935"
width="16"
height="16"
x="-297"
y="584"
transform="scale(-1,1)" />
<g <g
id="g4504"> id="g4504">
<rect <rect
@@ -719,7 +727,7 @@
y="584" y="584"
style="fill:none" /> style="fill:none" />
<rect <rect
style="fill:#9d9d9d;fill-opacity:1;stroke:none" style="fill:#303030"
id="rect3698" id="rect3698"
width="2" width="2"
height="5" height="5"
@@ -794,6 +802,14 @@
transform="matrix(-0.5,0,0,0.5,589.5,200)" transform="matrix(-0.5,0,0,0.5,589.5,200)"
clip-path="url(#clipPath3536)" clip-path="url(#clipPath3536)"
id="src/libs/utils/images/progressindicator_medium"> id="src/libs/utils/images/progressindicator_medium">
<rect
style="fill:#ffffff"
id="rect5933"
width="64"
height="64"
x="-393"
y="536"
transform="scale(-1,1)" />
<g <g
id="g3383"> id="g3383">
<rect <rect
@@ -809,7 +825,7 @@
height="18" height="18"
width="4" width="4"
id="rect3387" id="rect3387"
style="fill:#6d6d6d;fill-opacity:1;stroke:none" /> style="fill:#303030" />
</g> </g>
<use <use
x="0" x="0"
@@ -915,6 +931,14 @@
id="src/libs/utils/images/progressindicator_big" id="src/libs/utils/images/progressindicator_big"
clip-path="url(#clipPath3536)" clip-path="url(#clipPath3536)"
transform="matrix(-1,0,0,1,722,-100)"> transform="matrix(-1,0,0,1,722,-100)">
<rect
style="fill:#ffffff"
id="rect5931"
width="64"
height="64"
x="-393"
y="536"
transform="scale(-1,1)" />
<g <g
id="g3369"> id="g3369">
<rect <rect
@@ -926,7 +950,7 @@
style="opacity:0.41699997;fill:none;stroke:none" /> style="opacity:0.41699997;fill:none;stroke:none" />
<rect <rect
rx="2" rx="2"
style="fill:#6d6d6d;fill-opacity:1;stroke:none" style="fill:#303030"
id="rect3367" id="rect3367"
width="4" width="4"
height="17" height="17"

Before

Width:  |  Height:  |  Size: 307 KiB

After

Width:  |  Height:  |  Size: 307 KiB