mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 21:57:41 +02:00
Calculate radius and arm width with a formula to allow proper scaling
This commit is contained in:
@@ -85,22 +85,16 @@ AnimatedSpinner::init()
|
|||||||
size = sizeHint();
|
size = sizeHint();
|
||||||
else
|
else
|
||||||
size = m_pixmap.size();
|
size = m_pixmap.size();
|
||||||
if ( size.width() < 30 )
|
|
||||||
{
|
|
||||||
m_radius = 4;
|
/// Radius is best-fit line with points (13x13, 2), (28x28, 5), (48x48, 10)
|
||||||
|
m_radius = qRound( ( 23. * ( size.width() - 5.) ) / 100. );
|
||||||
m_armLength = size.width()/2 - m_radius;
|
m_armLength = size.width()/2 - m_radius;
|
||||||
m_armWidth = 2;
|
|
||||||
|
/// Arm width is best-fit line with points (13x13, 1), (28x28, 2), (48x48, 5)
|
||||||
|
m_armWidth = qRound( (116.*size.width() - 781.)/1000. );
|
||||||
m_border = 2;
|
m_border = 2;
|
||||||
m_armRect = QRect( m_radius, 0, m_armLength, m_armWidth );
|
m_armRect = QRect( m_radius, 0, m_armLength, m_armWidth );
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_radius = 10;
|
|
||||||
m_armLength = size.width()/2 - m_radius;
|
|
||||||
m_armWidth = 5;
|
|
||||||
m_border = 3;
|
|
||||||
m_armRect = QRect( m_radius, 0, m_armLength, m_armWidth );
|
|
||||||
}
|
|
||||||
|
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user