mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
Reenabled ProxyStyle under QtCurve, and fixed QSlider appearance.
This commit is contained in:
@@ -202,11 +202,7 @@ TomahawkWindow::saveSettings()
|
|||||||
void
|
void
|
||||||
TomahawkWindow::applyPlatformTweaks()
|
TomahawkWindow::applyPlatformTweaks()
|
||||||
{
|
{
|
||||||
// HACK QtCurve causes an infinite loop on startup. This is because setStyle calls setPalette, which calls ensureBaseStyle,
|
qApp->setStyle( new ProxyStyle() );
|
||||||
// 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() );
|
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
setUnifiedTitleAndToolBarOnMac( true );
|
setUnifiedTitleAndToolBarOnMac( true );
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
*
|
*
|
||||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||||
|
* Copyright 2012, Teo Mrnjavac <teo@kde.org>
|
||||||
*
|
*
|
||||||
* Tomahawk is free software: you can redistribute it and/or modify
|
* Tomahawk is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* 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
|
else
|
||||||
QProxyStyle::drawControl( ce, opt, p, w );
|
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 );
|
||||||
|
}
|
||||||
|
@@ -31,6 +31,7 @@ public:
|
|||||||
|
|
||||||
virtual void drawPrimitive( PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = 0 ) const;
|
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 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
|
#endif // PROXYSTYLE_H
|
||||||
|
Reference in New Issue
Block a user