From c0e627b7c61335c1b3059097a1730a59e06eb807 Mon Sep 17 00:00:00 2001
From: Leo Franchi <lfranchi@kde.org>
Date: Sat, 28 Apr 2012 17:14:05 -0400
Subject: [PATCH] Calculate radius and arm width with a formula to allow proper
 scaling

---
 src/libtomahawk/utils/AnimatedSpinner.cpp | 26 +++++++++--------------
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/src/libtomahawk/utils/AnimatedSpinner.cpp b/src/libtomahawk/utils/AnimatedSpinner.cpp
index 7f8c94b7d..7cdb7dda0 100644
--- a/src/libtomahawk/utils/AnimatedSpinner.cpp
+++ b/src/libtomahawk/utils/AnimatedSpinner.cpp
@@ -85,22 +85,16 @@ AnimatedSpinner::init()
         size = sizeHint();
     else
         size = m_pixmap.size();
-    if ( size.width() < 30 )
-    {
-        m_radius = 4;
-        m_armLength = size.width()/2 - m_radius;
-        m_armWidth = 2;
-        m_border = 2;
-        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 );
-    }
+
+
+    /// 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;
+
+    /// 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_armRect = QRect( m_radius, 0, m_armLength, m_armWidth );
 
     hide();
 }