From a19198b206e0123868d75c0641043b1db7032b7c Mon Sep 17 00:00:00 2001
From: Teo Mrnjavac <teo@kde.org>
Date: Thu, 2 Aug 2012 19:01:30 +0200
Subject: [PATCH] Removed the annoying thin grey line from the Queue splitter
 widget. Also made the ContextWidget header cursor a PointingHand because
 consistency is good.

---
 src/libtomahawk/context/ContextWidget.cpp    | 1 +
 src/libtomahawk/utils/ProxyStyle.cpp         | 7 ++++++-
 src/libtomahawk/widgets/AnimatedSplitter.cpp | 9 ++++-----
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/libtomahawk/context/ContextWidget.cpp b/src/libtomahawk/context/ContextWidget.cpp
index bbf0e8334..618d1a0fb 100644
--- a/src/libtomahawk/context/ContextWidget.cpp
+++ b/src/libtomahawk/context/ContextWidget.cpp
@@ -84,6 +84,7 @@ ContextWidget::ContextWidget( QWidget* parent )
     QPalette whitePal = ui->toggleButton->palette();
     whitePal.setColor( QPalette::Foreground, Qt::white );
     ui->toggleButton->setPalette( whitePal );
+    ui->toggleButton->setCursor( Qt::PointingHandCursor );
 
     QFont boldFont = ui->toggleButton->font();
     boldFont.setPixelSize( 12 );
diff --git a/src/libtomahawk/utils/ProxyStyle.cpp b/src/libtomahawk/utils/ProxyStyle.cpp
index 4a33e506f..fe57817c8 100644
--- a/src/libtomahawk/utils/ProxyStyle.cpp
+++ b/src/libtomahawk/utils/ProxyStyle.cpp
@@ -77,7 +77,12 @@ ProxyStyle::drawControl( ControlElement ce, const QStyleOption* opt, QPainter* p
         if ( !splitter->sizes().contains( 0 ) )
         {
             p->setPen( QColor( 0x8c, 0x8c, 0x8c ) );
-            p->drawLine( opt->rect.topLeft(), opt->rect.bottomRight() );
+            // We must special-case this because of the AnimatedSplitterHandle which has a
+            // SizeHint of 0,0.
+            if( splitter->orientation() == Qt::Vertical )
+                p->drawLine( opt->rect.topLeft(), opt->rect.topRight() );
+            else
+                p->drawLine( opt->rect.topLeft(), opt->rect.bottomRight() );
         }
     }
     else
diff --git a/src/libtomahawk/widgets/AnimatedSplitter.cpp b/src/libtomahawk/widgets/AnimatedSplitter.cpp
index 539433136..95992e19a 100644
--- a/src/libtomahawk/widgets/AnimatedSplitter.cpp
+++ b/src/libtomahawk/widgets/AnimatedSplitter.cpp
@@ -298,9 +298,8 @@ AnimatedSplitterHandle::sizeHint() const
         m_lastCount = splitter()->count();
     }
 
-    // sizeHint is 0,0 if widget below handle has size 0 or is hidden
-    if ( splitter()->widget( m_indexInSplitter )->height() == 0 )
-        return QSize( 0, 0 );
-    else
-        return QSize( 1, 1 );
+    // Since we are in an AnimatedSplitter, we always return 0,0 for SizeHint, simply
+    // because we know there's going to be a handle in the bottom widget to move the
+    // splitter.
+    return QSize( 0, 0 );
 }