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

* Fixed a few more font-size calculations.

This commit is contained in:
Christian Muehlhaeuser
2012-09-01 17:11:22 +02:00
parent 047f670980
commit 409c8afec1
3 changed files with 6 additions and 29 deletions

View File

@@ -80,17 +80,6 @@ TrackView::TrackView( QWidget* parent )
sortByColumn( -1 );
setContextMenuPolicy( Qt::CustomContextMenu );
#ifndef Q_WS_WIN
QFont f = font();
f.setPointSize( f.pointSize() - 1 );
setFont( f );
#endif
#ifdef Q_WS_MAC
f.setPointSize( f.pointSize() - 2 );
setFont( f );
#endif
m_timer.setInterval( SCROLL_TIMEOUT );
connect( verticalScrollBar(), SIGNAL( rangeChanged( int, int ) ), SLOT( onViewChanged() ) );
connect( verticalScrollBar(), SIGNAL( valueChanged( int ) ), SLOT( onViewChanged() ) );

View File

@@ -76,17 +76,6 @@ TreeView::TreeView( QWidget* parent )
setHeader( m_header );
setProxyModel( new TreeProxyModel( this ) );
#ifndef Q_WS_WIN
QFont f = font();
f.setPointSize( f.pointSize() - 1 );
setFont( f );
#endif
#ifdef Q_WS_MAC
f.setPointSize( f.pointSize() - 2 );
setFont( f );
#endif
m_timer.setInterval( SCROLL_TIMEOUT );
connect( verticalScrollBar(), SIGNAL( rangeChanged( int, int ) ), SLOT( onViewChanged() ) );
connect( verticalScrollBar(), SIGNAL( valueChanged( int ) ), SLOT( onViewChanged() ) );

View File

@@ -123,10 +123,9 @@ WelcomeWidget::WelcomeWidget( QWidget* parent )
m_tracksModel->setSource( source_ptr() );
QFont f;
f.setPointSize( 9 );
f.setBold( true );
QFontMetrics fm( f );
ui->tracksView->setMinimumWidth( fm.width( tr("Recently played tracks") ) * 2 );
ui->tracksView->setMinimumWidth( fm.width( tr( "Recently played tracks" ) ) * 2 );
m_recentAlbumsModel = new AlbumModel( ui->additionsView );
ui->additionsView->setPlayableModel( m_recentAlbumsModel );
@@ -257,9 +256,9 @@ PlaylistDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelInde
int height = 2 * 6; // margins
QFont font = option.font;
QFontMetrics fm1( font );
font.setPointSize( 8 );
font.setPointSize( TomahawkUtils::defaultFontSize() - 1 );
height += fm1.height() * 3;
font.setPointSize( 9 );
font.setPointSize( TomahawkUtils::defaultFontSize() );
QFontMetrics fm2( font );
height += fm2.height();
@@ -286,15 +285,15 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
QTextOption to;
to.setAlignment( Qt::AlignCenter );
QFont font = opt.font;
font.setPointSize( 8 );
font.setPointSize( TomahawkUtils::defaultFontSize() - 1 );
QFont boldFont = font;
boldFont.setBold( true );
boldFont.setPointSize( 9 );
boldFont.setPointSize( TomahawkUtils::defaultFontSize() );
QFontMetrics boldFontMetrics( boldFont );
QFont figFont = boldFont;
figFont.setPointSize( 8 );
figFont.setPointSize( TomahawkUtils::defaultFontSize() - 1 );
QPixmap icon;
RecentlyPlayedPlaylistsModel::PlaylistTypes type = (RecentlyPlayedPlaylistsModel::PlaylistTypes)index.data( RecentlyPlayedPlaylistsModel::PlaylistTypeRole ).toInt();