From 3bfd7fed263c1dc7c5efd59774a075adbdc52ba8 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 22 Aug 2014 01:34:10 +0200 Subject: [PATCH] * Use default font sizes. --- src/libtomahawk/playlist/PlaylistItemDelegate.cpp | 4 ++-- src/libtomahawk/widgets/QueryLabel.cpp | 5 +++-- .../widgets/infowidgets/ArtistInfoWidget.cpp | 14 +++++++------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/libtomahawk/playlist/PlaylistItemDelegate.cpp b/src/libtomahawk/playlist/PlaylistItemDelegate.cpp index 0c86af95c..ab9c69e4f 100644 --- a/src/libtomahawk/playlist/PlaylistItemDelegate.cpp +++ b/src/libtomahawk/playlist/PlaylistItemDelegate.cpp @@ -546,7 +546,7 @@ PlaylistItemDelegate::drawSource( QPainter* painter, const QStyleOptionViewItem& QTextOption to = QTextOption( Qt::AlignVCenter ); to.setWrapMode( QTextOption::NoWrap ); QFont f = painter->font(); - f.setPointSize( 12 ); + f.setPointSize( TomahawkUtils::defaultFontSize() + 2 ); painter->setFont( f ); painter->setOpacity( 0.8 ); @@ -583,7 +583,7 @@ PlaylistItemDelegate::drawTrack( QPainter* painter, const QStyleOptionViewItem& const int margin = 8; QFont f = painter->font(); - f.setPointSize( 11 ); + f.setPointSize( TomahawkUtils::defaultFontSize() + 1 ); f.setWeight( QFont::DemiBold ); painter->setFont( f ); diff --git a/src/libtomahawk/widgets/QueryLabel.cpp b/src/libtomahawk/widgets/QueryLabel.cpp index bf253c2c5..64f49d828 100644 --- a/src/libtomahawk/widgets/QueryLabel.cpp +++ b/src/libtomahawk/widgets/QueryLabel.cpp @@ -259,7 +259,8 @@ QSize QueryLabel::sizeHint() const { 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; } @@ -275,7 +276,7 @@ QueryLabel::minimumSizeHint() const default: { 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; } } diff --git a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp index 75574036b..dcb0ca7ea 100644 --- a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp +++ b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp @@ -127,7 +127,7 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget* { QFont f = ui->biography->font(); f.setWeight( QFont::Light ); - f.setPointSize( 13 ); + f.setPointSize( TomahawkUtils::defaultFontSize() + 3 ); ui->biography->setFont( f ); 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 ) ) ); - f.setPointSize( 11 ); + f.setPointSize( TomahawkUtils::defaultFontSize() + 1 ); ui->topHitsMoreLabel->setFont( f ); ui->albumsMoreLabel->setFont( f ); @@ -155,7 +155,7 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget* { QFont f = uiHeader->artistLabel->font(); f.setBold( true ); - f.setPointSize( 16 ); + f.setPointSize( TomahawkUtils::defaultFontSize() + 6 ); QPalette p = uiHeader->artistLabel->palette(); p.setColor( QPalette::Foreground, Qt::white ); @@ -163,7 +163,7 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget* uiHeader->artistLabel->setFont( f ); uiHeader->artistLabel->setPalette( p ); - f.setPointSize( 11 ); + f.setPointSize( TomahawkUtils::defaultFontSize() + 1 ); f.setBold( true ); uiHeader->anchor1Label->setFont( f ); uiHeader->anchor1Label->setPalette( p ); @@ -180,9 +180,9 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget* uiHeader->anchor3Label->setText( tr( "Related Artists" ) ); QFontMetrics fm( f ); - uiHeader->anchor1Label->setFixedWidth( fm.width( uiHeader->anchor1Label->text() + uiHeader->anchor1Label->contentsMargins().left() * 2 ) ); - uiHeader->anchor2Label->setFixedWidth( fm.width( uiHeader->anchor2Label->text() + uiHeader->anchor1Label->contentsMargins().left() * 2 ) ); - uiHeader->anchor3Label->setFixedWidth( fm.width( uiHeader->anchor3Label->text() + uiHeader->anchor1Label->contentsMargins().left() * 2 ) ); + uiHeader->anchor1Label->setFixedWidth( fm.width( uiHeader->anchor1Label->text() ) + 16 ); + uiHeader->anchor2Label->setFixedWidth( fm.width( uiHeader->anchor2Label->text() ) + 16 ); + uiHeader->anchor3Label->setFixedWidth( fm.width( uiHeader->anchor3Label->text() ) + 16 ); connect( uiHeader->anchor1Label, SIGNAL( clicked() ), SLOT( onMusicAnchorClicked() ) ); connect( uiHeader->anchor2Label, SIGNAL( clicked() ), SLOT( onBioAnchorClicked() ) );