1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 19:30:21 +02:00

* Use default font sizes.

This commit is contained in:
Christian Muehlhaeuser
2014-08-22 01:34:10 +02:00
parent 82ceec54b1
commit 3bfd7fed26
3 changed files with 12 additions and 11 deletions

View File

@@ -546,7 +546,7 @@ PlaylistItemDelegate::drawSource( QPainter* painter, const QStyleOptionViewItem&
QTextOption to = QTextOption( Qt::AlignVCenter ); QTextOption to = QTextOption( Qt::AlignVCenter );
to.setWrapMode( QTextOption::NoWrap ); to.setWrapMode( QTextOption::NoWrap );
QFont f = painter->font(); QFont f = painter->font();
f.setPointSize( 12 ); f.setPointSize( TomahawkUtils::defaultFontSize() + 2 );
painter->setFont( f ); painter->setFont( f );
painter->setOpacity( 0.8 ); painter->setOpacity( 0.8 );
@@ -583,7 +583,7 @@ PlaylistItemDelegate::drawTrack( QPainter* painter, const QStyleOptionViewItem&
const int margin = 8; const int margin = 8;
QFont f = painter->font(); QFont f = painter->font();
f.setPointSize( 11 ); f.setPointSize( TomahawkUtils::defaultFontSize() + 1 );
f.setWeight( QFont::DemiBold ); f.setWeight( QFont::DemiBold );
painter->setFont( f ); painter->setFont( f );

View File

@@ -259,7 +259,8 @@ QSize
QueryLabel::sizeHint() const QueryLabel::sizeHint() const
{ {
const QFontMetrics& fm = fontMetrics(); const QFontMetrics& fm = fontMetrics();
QSize size( fm.width( text() ) + contentsMargins().left() * 2, fm.height() + contentsMargins().top() * 2 ); QSize size( fm.width( text() ) + contentsMargins().left() + contentsMargins().right(),
fm.height() + contentsMargins().top() + contentsMargins().bottom() );
return size; return size;
} }
@@ -275,7 +276,7 @@ QueryLabel::minimumSizeHint() const
default: default:
{ {
const QFontMetrics& fm = fontMetrics(); const QFontMetrics& fm = fontMetrics();
QSize size( fm.width( "..." ), fm.height() + contentsMargins().top() * 2 ); QSize size( fm.width( "..." ), fm.height() + contentsMargins().top() + contentsMargins().bottom() );
return size; return size;
} }
} }

View File

@@ -127,7 +127,7 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
{ {
QFont f = ui->biography->font(); QFont f = ui->biography->font();
f.setWeight( QFont::Light ); f.setWeight( QFont::Light );
f.setPointSize( 13 ); f.setPointSize( TomahawkUtils::defaultFontSize() + 3 );
ui->biography->setFont( f ); ui->biography->setFont( f );
ui->biography->setOpenLinks( false ); ui->biography->setOpenLinks( false );
@@ -144,7 +144,7 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
connect( ui->biography, SIGNAL( anchorClicked( QUrl ) ), SLOT( onBiographyLinkClicked( QUrl ) ) ); connect( ui->biography, SIGNAL( anchorClicked( QUrl ) ), SLOT( onBiographyLinkClicked( QUrl ) ) );
f.setPointSize( 11 ); f.setPointSize( TomahawkUtils::defaultFontSize() + 1 );
ui->topHitsMoreLabel->setFont( f ); ui->topHitsMoreLabel->setFont( f );
ui->albumsMoreLabel->setFont( f ); ui->albumsMoreLabel->setFont( f );
@@ -155,7 +155,7 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
{ {
QFont f = uiHeader->artistLabel->font(); QFont f = uiHeader->artistLabel->font();
f.setBold( true ); f.setBold( true );
f.setPointSize( 16 ); f.setPointSize( TomahawkUtils::defaultFontSize() + 6 );
QPalette p = uiHeader->artistLabel->palette(); QPalette p = uiHeader->artistLabel->palette();
p.setColor( QPalette::Foreground, Qt::white ); p.setColor( QPalette::Foreground, Qt::white );
@@ -163,7 +163,7 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
uiHeader->artistLabel->setFont( f ); uiHeader->artistLabel->setFont( f );
uiHeader->artistLabel->setPalette( p ); uiHeader->artistLabel->setPalette( p );
f.setPointSize( 11 ); f.setPointSize( TomahawkUtils::defaultFontSize() + 1 );
f.setBold( true ); f.setBold( true );
uiHeader->anchor1Label->setFont( f ); uiHeader->anchor1Label->setFont( f );
uiHeader->anchor1Label->setPalette( p ); uiHeader->anchor1Label->setPalette( p );
@@ -180,9 +180,9 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
uiHeader->anchor3Label->setText( tr( "Related Artists" ) ); uiHeader->anchor3Label->setText( tr( "Related Artists" ) );
QFontMetrics fm( f ); QFontMetrics fm( f );
uiHeader->anchor1Label->setFixedWidth( fm.width( uiHeader->anchor1Label->text() + uiHeader->anchor1Label->contentsMargins().left() * 2 ) ); uiHeader->anchor1Label->setFixedWidth( fm.width( uiHeader->anchor1Label->text() ) + 16 );
uiHeader->anchor2Label->setFixedWidth( fm.width( uiHeader->anchor2Label->text() + uiHeader->anchor1Label->contentsMargins().left() * 2 ) ); uiHeader->anchor2Label->setFixedWidth( fm.width( uiHeader->anchor2Label->text() ) + 16 );
uiHeader->anchor3Label->setFixedWidth( fm.width( uiHeader->anchor3Label->text() + uiHeader->anchor1Label->contentsMargins().left() * 2 ) ); uiHeader->anchor3Label->setFixedWidth( fm.width( uiHeader->anchor3Label->text() ) + 16 );
connect( uiHeader->anchor1Label, SIGNAL( clicked() ), SLOT( onMusicAnchorClicked() ) ); connect( uiHeader->anchor1Label, SIGNAL( clicked() ), SLOT( onMusicAnchorClicked() ) );
connect( uiHeader->anchor2Label, SIGNAL( clicked() ), SLOT( onBioAnchorClicked() ) ); connect( uiHeader->anchor2Label, SIGNAL( clicked() ), SLOT( onBioAnchorClicked() ) );