1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-22 00:42:04 +02:00

* Moved color consts into TomahawkStyle.

This commit is contained in:
Christian Muehlhaeuser 2013-04-29 19:22:00 +02:00
parent e6c2498fc6
commit f99cfb8e66
14 changed files with 60 additions and 29 deletions

@ -100,8 +100,10 @@ ResolverConfigDelegate::paint( QPainter* painter, const QStyleOptionViewItem& op
QString pathStr = index.data( ResolversModel::ResolverPath ).toString();
if( error )
{
//FIXME const color
painter->setPen( QColor( Qt::red ).lighter( 150 ) );
} else {
//FIXME const color
painter->setPen( Qt::gray );
}

@ -93,7 +93,7 @@ ContextWidget::ContextWidget( QWidget* parent )
ensurePolished();
QPalette pal = palette();
pal.setBrush( QPalette::Window, QColor( "#272b2e" ) );
pal.setBrush( QPalette::Window, TomahawkStyle::FOOTNOTES_BACKGROUND );
setPalette( pal );
connect( ui->toggleButton, SIGNAL( clicked() ), SLOT( toggleSize() ) );

@ -66,7 +66,7 @@ ACLJobDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
QString mainText = QString( tr( "Allow %1 to\nconnect and stream from you?" ) ).arg( item->username() );
//tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Displaying text:" << mainText;
const QRect rRect( opt.rect.left() + PADDING, opt.rect.top() + 4*PADDING, opt.rect.width() - 2*PADDING, opt.rect.height() - 2*PADDING );
painter->drawText( rRect, Qt::AlignHCenter, mainText );
@ -79,7 +79,7 @@ ACLJobDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
painter->setPen( Qt::white );
int minPixels = 20;
QString allowBtnText = tr( "Allow Streaming" );
int allowBtnWidth = fm.width( allowBtnText ) + 2 * PADDING;
allowBtnRect = QRect( opt.rect.left() + thirds - allowBtnWidth / 2, opt.rect.bottom() - fm.height() - 4 * PADDING, allowBtnWidth + 2 * PADDING, fm.height() + 2 * PADDING );
@ -113,6 +113,7 @@ ACLJobDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelIndex&
void
ACLJobDelegate::drawRoundedButton( QPainter* painter, const QRect& btnRect, bool red ) const
{
//FIXME const colors
if ( !red )
TomahawkUtils::drawRoundedButton( painter, btnRect, QColor( 54, 127, 211 ), QColor( 43, 104, 182 ), QColor( 34, 85, 159 ), QColor( 35, 79, 147 ) );
else
@ -175,7 +176,7 @@ void
ACLJobItem::createDelegate( QObject* parent )
{
tLog() << Q_FUNC_INFO;
if ( m_delegate )
return;

@ -43,6 +43,8 @@ namespace TomahawkStyle
static const QColor BORDER_LINE = QColor( "#8c8c8c" );
static const QColor POPUP_BACKGROUND = QColor( "#ffffff" );
static const QColor POPUP_OSX_BACKGROUND = QColor( "#D6E3F1" );
static const QColor GROUP_HEADER = QColor( "#637180" );
static const QColor HOVER_GLOW = QColor( "#dddddd" );
@ -56,8 +58,24 @@ namespace TomahawkStyle
static const QColor HEADER_TEXT = QColor( "#eaeaea" );
static const QColor HEADER_HIGHLIGHT = QColor( "#333" );
static const QColor PAGE_BACKGROUND = QColor( "#272b2e" );
static const QColor FOOTNOTES_BACKGROUND = QColor( "#272b2e" );
static const QColor DASHBOARD_ROUNDFIGURE_BACKGROUND = QColor( "#454e59" );
static const QColor SIDEBAR_ROUNDFIGURE_BACKGROUND = QColor( 167, 183, 211 );
static const QColor SIDEBAR_ROUNDFIGURE_INBOX_BACKGROUND = QColor( 239, 140, 51 );
static const QColor SIDEBAR_LAZYLIST_UPPER = QColor( "#ffffff" );
static const QColor SIDEBAR_LAZYLIST_LOWER = QColor( 0x88, 0x88, 0x88 );
static const QColor SIDEBAR_LAZYLIST_LOWEST = QColor( 0x99, 0x99, 0x99 );
static const QColor SLIDESWITCH_CHECKED_TOP = QColor( 8, 54, 134 );
static const QColor SLIDESWITCH_CHECKED_BOTTOM = QColor( 118, 172, 240 );
static const QColor SLIDESWITCH_UNCHECKED_TOP = QColor( 128, 128, 128 );
static const QColor SLIDESWITCH_UNCHECKED_BOTTOM = QColor( 179, 179, 179 );
static const QColor SLIDESWITCH_TEXT = QColor( "#606060" );
static const int POPUP_ROUNDING_RADIUS = 6;
static const float POPUP_OPACITY = 0.96;
static const float POPUP_OPACITY = 0.93;
}
#endif // TOMAHAWKSTYLE_H

@ -19,8 +19,9 @@
#include "BasicHeader.h"
#include "utils/TomahawkUtilsGui.h"
#include "ElidedLabel.h"
#include "utils/TomahawkStyle.h"
#include "utils/TomahawkUtilsGui.h"
#include <QLabel>
#include <QPixmap>
@ -129,8 +130,8 @@ BasicHeader::paintEvent( QPaintEvent* event )
QLinearGradient gradient( QPoint( 0, 0 ), QPoint( 0, 1 ) );
gradient.setCoordinateMode( QGradient::ObjectBoundingMode );
gradient.setColorAt( 0.0, QColor( "#707070" ) );
gradient.setColorAt( 1.0, QColor( "#25292c" ) );
gradient.setColorAt( 0.0, TomahawkStyle::HEADER_LOWER );
gradient.setColorAt( 1.0, TomahawkStyle::HEADER_UPPER );
painter.setBrush( gradient );
painter.fillRect( rect(), gradient );

@ -138,6 +138,7 @@ OverlayButton::paintEvent( QPaintEvent* event )
QPen pen( palette().dark().color(), .5 );
p.setPen( pen );
//FIXME const color
p.setBrush( QColor( 30, 30, 30, 255.0 * OPACITY ) );
p.drawRoundedRect( r, CORNER_ROUNDNESS, CORNER_ROUNDNESS );

@ -215,6 +215,7 @@ OverlayWidget::paintEvent( QPaintEvent* event )
QPen pen( palette().dark().color(), .5 );
p.setPen( pen );
//FIXME const color
p.setBrush( QColor( 30, 30, 30, 255.0 * OPACITY ) );
p.drawRoundedRect( r, CORNER_ROUNDNESS, CORNER_ROUNDNESS );

@ -213,8 +213,8 @@ SourceTreePopupDialog::paintEvent( QPaintEvent* event )
TomahawkUtils::drawCompositedPopup( this,
outline,
TomahawkStyle::BORDER_LINE,
QColor( "#D6E3F1" ),
0.93 );
TomahawkStyle::POPUP_OSX_BACKGROUND,
TomahawkStyle::POPUP_OPACITY );
#endif
}

@ -25,17 +25,18 @@
#include "SourceList.h"
#include "TomahawkSettings.h"
#include "RecentPlaylistsModel.h"
#include "RecentlyPlayedPlaylistsModel.h"
#include "MetaPlaylistInterface.h"
#include "audio/AudioEngine.h"
#include "playlist/AlbumModel.h"
#include "playlist/RecentlyPlayedModel.h"
#include "playlist/dynamic/GeneratorInterface.h"
#include "widgets/OverlayWidget.h"
#include "utils/AnimatedSpinner.h"
#include "utils/TomahawkStyle.h"
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
#include "playlist/dynamic/GeneratorInterface.h"
#include "RecentlyPlayedPlaylistsModel.h"
#include <QPainter>
@ -282,7 +283,7 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
rect.setTop( pixmapRect.bottom() - painter->fontMetrics().height() - 1 );
rect.setBottom( pixmapRect.bottom() + 1 );
QColor figColor( "#454e59" );
QColor figColor( TomahawkStyle::DASHBOARD_ROUNDFIGURE_BACKGROUND );
painter->setPen( figColor );
painter->setBrush( figColor );
@ -319,6 +320,7 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
QColor c = painter->pen().color();
if ( !( option.state & QStyle::State_Selected && option.state & QStyle::State_Active ) )
{
//FIXME const color
painter->setPen( QColor( Qt::gray ).darker() );
}

@ -34,6 +34,7 @@
#include "database/DatabaseCommand_AllTracks.h"
#include "database/DatabaseCommand_AllAlbums.h"
#include "utils/TomahawkStyle.h"
#include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h"
@ -51,7 +52,7 @@ AlbumInfoWidget::AlbumInfoWidget( const Tomahawk::album_ptr& album, QWidget* par
ui->setupUi( widget );
QPalette pal = palette();
pal.setColor( QPalette::Window, QColor( "#272b2e" ) );
pal.setColor( QPalette::Window, TomahawkStyle::PAGE_BACKGROUND );
widget->setPalette( pal );
widget->setAutoFillBackground( true );

@ -37,6 +37,7 @@
#include "GlobalActionManager.h"
#include "Pipeline.h"
#include "MetaPlaylistInterface.h"
#include "utils/TomahawkStyle.h"
#include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h"
@ -52,7 +53,7 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
ui->setupUi( widget );
QPalette pal = palette();
pal.setColor( QPalette::Window, QColor( "##272b2e" ) );
pal.setColor( QPalette::Window, TomahawkStyle::PAGE_BACKGROUND );
widget->setPalette( pal );
widget->setAutoFillBackground( true );

@ -29,6 +29,7 @@
#include "playlist/PlayableModel.h"
#include "audio/AudioEngine.h"
#include "utils/TomahawkStyle.h"
#include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h"
@ -44,7 +45,7 @@ TrackInfoWidget::TrackInfoWidget( const Tomahawk::query_ptr& query, QWidget* par
ui->setupUi( widget );
QPalette pal = palette();
pal.setColor( QPalette::Window, QColor( "#272b2e" ) );
pal.setColor( QPalette::Window, TomahawkStyle::PAGE_BACKGROUND );
widget->setPalette( pal );
widget->setAutoFillBackground( true );

@ -355,7 +355,7 @@ SourceDelegate::paintCollection( QPainter* painter, const QStyleOptionViewItem&
painter->setFont( figFont );
QColor figColor( 167, 183, 211 );
QColor figColor( TomahawkStyle::SIDEBAR_ROUNDFIGURE_BACKGROUND );
painter->setPen( figColor );
painter->setBrush( figColor );
@ -529,9 +529,9 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
if ( m_gradient.finalStop() != itemsRect.bottomLeft() )
{
m_gradient = QLinearGradient( itemsRect.topLeft(), itemsRect.bottomLeft() );
m_gradient.setColorAt( 0.0, Qt::white );
m_gradient.setColorAt( 0.9, QColor( 0x88, 0x88, 0x88 ) );
m_gradient.setColorAt( 1.0, QColor( 0x99, 0x99, 0x99 ) ); // dark grey
m_gradient.setColorAt( 0.0, TomahawkStyle::SIDEBAR_LAZYLIST_UPPER );
m_gradient.setColorAt( 0.9, TomahawkStyle::SIDEBAR_LAZYLIST_LOWER );
m_gradient.setColorAt( 1.0, TomahawkStyle::SIDEBAR_LAZYLIST_LOWEST );
}
QPen pen = painter->pen();
@ -661,7 +661,7 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
painter->setFont( figFont );
QColor figColor( 239, 140, 51 );
QColor figColor( TomahawkStyle::SIDEBAR_ROUNDFIGURE_INBOX_BACKGROUND );
painter->setPen( figColor );
painter->setBrush( figColor );

@ -19,6 +19,7 @@
#include "SlideSwitchButton.h"
#include "utils/TomahawkStyle.h"
#include "utils/TomahawkUtils.h"
#include <QMouseEvent>
@ -66,17 +67,17 @@ SlideSwitchButton::init()
setMouseTracking( true );
#endif
m_backCheckedColorTop = QColor( 8, 54, 134 );
m_backCheckedColorBottom = QColor( 118, 172, 240 );
m_backUncheckedColorTop = QColor( 128, 128, 128 );
m_backUncheckedColorBottom = QColor( 179, 179, 179 );
m_backCheckedColorTop = TomahawkStyle::SLIDESWITCH_CHECKED_TOP;
m_backCheckedColorBottom = TomahawkStyle::SLIDESWITCH_CHECKED_BOTTOM;
m_backUncheckedColorTop = TomahawkStyle::SLIDESWITCH_UNCHECKED_TOP;
m_backUncheckedColorBottom = TomahawkStyle::SLIDESWITCH_UNCHECKED_BOTTOM;
m_baseColorTop = m_backUncheckedColorTop;
m_baseColorBottom = m_backUncheckedColorBottom;
m_textColor = QColor( "#606060" );
setFocusPolicy( Qt::NoFocus );
m_textColor = TomahawkStyle::SLIDESWITCH_TEXT;
setFocusPolicy( Qt::NoFocus );
m_knobX = 0.;
m_textFont = font();
@ -179,8 +180,8 @@ SlideSwitchButton::paintEvent( QPaintEvent* event )
QLinearGradient gradient( 0, 0, 0, 1 );
gradient.setCoordinateMode( QGradient::ObjectBoundingMode );
gradient.setColorAt( 0, m_baseColorTop );
gradient.setColorAt( 1, m_baseColorBottom );
gradient.setColorAt( 0, TomahawkStyle::SLIDESWITCH_UNCHECKED_TOP );
gradient.setColorAt( 1, TomahawkStyle::SLIDESWITCH_UNCHECKED_BOTTOM );
painter.setBrush( gradient );
QPainterPath borderPath;
@ -275,6 +276,7 @@ SlideSwitchButton::createKnob()
QLinearGradient gradient( 0, 0, 0, 1 );
gradient.setCoordinateMode( QGradient::ObjectBoundingMode );
//FIXME const colors
gradient.setColorAt( 0, Qt::white );
gradient.setColorAt( 1, QColor( 223, 223, 223 ) );