diff --git a/src/TomahawkWindow.cpp b/src/TomahawkWindow.cpp index 09e6fe70d..7949baa62 100644 --- a/src/TomahawkWindow.cpp +++ b/src/TomahawkWindow.cpp @@ -202,11 +202,7 @@ TomahawkWindow::saveSettings() void TomahawkWindow::applyPlatformTweaks() { - // HACK QtCurve causes an infinite loop on startup. This is because setStyle calls setPalette, which calls ensureBaseStyle, - // which loads QtCurve. QtCurve calls setPalette, which creates an infinite loop. The UI will look like CRAP with QtCurve, but - // the user is asking for it explicitly... so he's gonna be stuck with an ugly UI. - if ( !QString( qApp->style()->metaObject()->className() ).toLower().contains( "qtcurve" ) ) - qApp->setStyle( new ProxyStyle() ); + qApp->setStyle( new ProxyStyle() ); #ifdef Q_OS_MAC setUnifiedTitleAndToolBarOnMac( true ); diff --git a/src/libtomahawk/utils/ProxyStyle.cpp b/src/libtomahawk/utils/ProxyStyle.cpp index cb7cd45e1..4a33e506f 100644 --- a/src/libtomahawk/utils/ProxyStyle.cpp +++ b/src/libtomahawk/utils/ProxyStyle.cpp @@ -1,6 +1,7 @@ /* === This file is part of Tomahawk Player - === * * Copyright 2010-2011, Christian Muehlhaeuser + * Copyright 2012, Teo Mrnjavac * * Tomahawk is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -82,3 +83,18 @@ ProxyStyle::drawControl( ControlElement ce, const QStyleOption* opt, QPainter* p else QProxyStyle::drawControl( ce, opt, p, w ); } + +QSize +ProxyStyle::sizeFromContents( QStyle::ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget ) const +{ + if( type == CT_Splitter ) + { + const QSplitter* splitter = qobject_cast< const QSplitter* >( widget ); + if( splitter->orientation() == Qt::Horizontal ) + return QSize( 1, size.height() ); + else + return QSize( size.width(), 1 ); + } + else + return QProxyStyle::sizeFromContents( type, option, size, widget ); +} diff --git a/src/libtomahawk/utils/ProxyStyle.h b/src/libtomahawk/utils/ProxyStyle.h index 0a8d636ca..aa1dec625 100644 --- a/src/libtomahawk/utils/ProxyStyle.h +++ b/src/libtomahawk/utils/ProxyStyle.h @@ -31,6 +31,7 @@ public: virtual void drawPrimitive( PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = 0 ) const; virtual void drawControl( ControlElement ce, const QStyleOption *opt, QPainter *p, const QWidget *w = 0 ) const; + virtual QSize sizeFromContents( ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget ) const; }; #endif // PROXYSTYLE_H