Commit c01da18a authored by Oleg Solovyov's avatar Oleg Solovyov Committed by Albert Astals Cid

Fix progress in tray

BUG: 384141

If m_runningTea.time() > 360*16 (> 1.6 hours) then
360*16.0 / m_runningTea.time() converts to zero (integer division)
Hence, angleSpan is always 0

Differential Revision: https://phabricator.kde.org/D9791
parent 986ded54
......@@ -254,7 +254,7 @@ void TopLevel::repaintTrayIcon()
const QRectF rectangle( 1, icon.height() / 3 + 1, icon.width() / 1.5 - 2, icon.height() / 1.5 - 2 );
const int startAngle = 90 * 16;
const int angleSpan = -( 360*16 / m_runningTea.time() * m_runningTeaTime );
const int angleSpan = -( 360*16.0 / m_runningTea.time() * m_runningTeaTime );
painter.setBrush( QColor( 0, 255, 0, 90 ) );
painter.drawPie( rectangle, startAngle, 360*16 + angleSpan );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment