From e772dcecad0604c653c45843e73bf090b4261458 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 6 Sep 2011 08:16:43 +0200 Subject: [PATCH] * Fixed TWK-438: Get rid of splitter handles in the sidebar. --- src/libtomahawk/utils/proxystyle.cpp | 7 ------- src/libtomahawk/widgets/animatedsplitter.cpp | 7 +++++++ src/libtomahawk/widgets/animatedsplitter.h | 21 ++++++++++++++++++++ src/tomahawkwindow.cpp | 2 -- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/libtomahawk/utils/proxystyle.cpp b/src/libtomahawk/utils/proxystyle.cpp index 0c1bf1dc0..1e906f0f6 100644 --- a/src/libtomahawk/utils/proxystyle.cpp +++ b/src/libtomahawk/utils/proxystyle.cpp @@ -80,13 +80,6 @@ ProxyStyle::drawControl( ControlElement ce, const QStyleOption* opt, QPainter* p p->setPen( QColor( 0x8c, 0x8c, 0x8c ) ); p->drawLine( opt->rect.topLeft(), opt->rect.bottomRight() ); } -#ifndef Q_WS_MAC - else - { - p->setPen( QColor( 0xff, 0xff, 0xff ) ); - p->drawLine( opt->rect.topLeft(), opt->rect.bottomRight() ); - } -#endif } else QProxyStyle::drawControl( ce, opt, p, w ); diff --git a/src/libtomahawk/widgets/animatedsplitter.cpp b/src/libtomahawk/widgets/animatedsplitter.cpp index 45b4092ab..392db19cb 100644 --- a/src/libtomahawk/widgets/animatedsplitter.cpp +++ b/src/libtomahawk/widgets/animatedsplitter.cpp @@ -145,6 +145,13 @@ AnimatedSplitter::setGreedyWidget( int index ) } +QSplitterHandle* +AnimatedSplitter::createHandle() +{ + return new AnimatedSplitterHandle( orientation(), this ); +} + + AnimatedWidget::AnimatedWidget( AnimatedSplitter* parent ) : m_parent( parent ) , m_isHidden( false ) diff --git a/src/libtomahawk/widgets/animatedsplitter.h b/src/libtomahawk/widgets/animatedsplitter.h index 8c0c19502..5bc64124c 100644 --- a/src/libtomahawk/widgets/animatedsplitter.h +++ b/src/libtomahawk/widgets/animatedsplitter.h @@ -45,6 +45,9 @@ signals: void shown( QWidget*, bool animated ); void hidden( QWidget*, bool animated ); +protected: + virtual QSplitterHandle* createHandle(); + private slots: void onShowRequest(); void onHideRequest(); @@ -55,6 +58,24 @@ private: int m_greedyIndex; }; + +class DLLEXPORT AnimatedSplitterHandle : public QSplitterHandle +{ +Q_OBJECT +public: + explicit AnimatedSplitterHandle( Qt::Orientation orientation, QSplitter* parent ) + : QSplitterHandle( orientation, parent ) + { + setCursor( Qt::ArrowCursor ); + } + + virtual QSize sizeHint() const + { + return QSize( 0, 0 ); + } +}; + + class DLLEXPORT AnimatedWidget : public QWidget { Q_OBJECT diff --git a/src/tomahawkwindow.cpp b/src/tomahawkwindow.cpp index 1be3d343f..64291ea61 100644 --- a/src/tomahawkwindow.cpp +++ b/src/tomahawkwindow.cpp @@ -391,7 +391,6 @@ TomahawkWindow::hideEvent( QHideEvent* e ) void TomahawkWindow::showSettingsDialog() { - qDebug() << Q_FUNC_INFO; SettingsDialog win; win.exec(); } @@ -399,7 +398,6 @@ TomahawkWindow::showSettingsDialog() void TomahawkWindow::showDiagnosticsDialog() { - qDebug() << Q_FUNC_INFO; DiagnosticsDialog win; win.exec(); }