mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 15:47:38 +02:00
mac-specific tweaks
This commit is contained in:
@@ -380,6 +380,10 @@ drawBackgroundAndNumbers( QPainter* painter, const QString& text, const QRect& f
|
|||||||
|
|
||||||
painter->setPen( origpen );
|
painter->setPen( origpen );
|
||||||
|
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
figRect.adjust( -1, 0, 0, 0 );
|
||||||
|
#endif
|
||||||
|
|
||||||
QTextOption to( Qt::AlignCenter );
|
QTextOption to( Qt::AlignCenter );
|
||||||
painter->setPen( Qt::white );
|
painter->setPen( Qt::white );
|
||||||
painter->drawText( figRect.adjusted( -5, 0, 6, 0 ), text, to );
|
painter->drawText( figRect.adjusted( -5, 0, 6, 0 ), text, to );
|
||||||
|
@@ -71,6 +71,9 @@ WelcomeWidget::WelcomeWidget( QWidget* parent )
|
|||||||
ui->playlistWidget->setItemDelegate( new PlaylistDelegate() );
|
ui->playlistWidget->setItemDelegate( new PlaylistDelegate() );
|
||||||
ui->playlistWidget->setModel( model );
|
ui->playlistWidget->setModel( model );
|
||||||
ui->playlistWidget->overlay()->resize( 380, 86 );
|
ui->playlistWidget->overlay()->resize( 380, 86 );
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
ui->playlistWidget->setVerticalScrollMode( QAbstractItemView::ScrollPerPixel );
|
||||||
|
#endif
|
||||||
|
|
||||||
connect( model, SIGNAL( emptinessChanged( bool) ), this, SLOT( updatePlaylists() ) );
|
connect( model, SIGNAL( emptinessChanged( bool) ), this, SLOT( updatePlaylists() ) );
|
||||||
|
|
||||||
@@ -219,7 +222,11 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
|||||||
QTextOption to;
|
QTextOption to;
|
||||||
to.setAlignment( Qt::AlignCenter );
|
to.setAlignment( Qt::AlignCenter );
|
||||||
QFont font = opt.font;
|
QFont font = opt.font;
|
||||||
QFont boldFont = opt.font;
|
#ifdef Q_OS_MAC
|
||||||
|
font.setPointSize( font.pointSize() - 2 );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QFont boldFont = font;
|
||||||
boldFont.setBold( true );
|
boldFont.setBold( true );
|
||||||
|
|
||||||
QPixmap icon;
|
QPixmap icon;
|
||||||
@@ -246,8 +253,20 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
|||||||
}
|
}
|
||||||
QColor c = painter->pen().color();
|
QColor c = painter->pen().color();
|
||||||
painter->setPen( QColor( Qt::gray ).darker() );
|
painter->setPen( QColor( Qt::gray ).darker() );
|
||||||
painter->drawText( option.rect.adjusted( 66, 19, -100, -8 ), descText );
|
QFont font2 = font;
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
font2.setPointSize( font2.pointSize() - 1 );
|
||||||
|
#endif
|
||||||
|
painter->setFont( font2 );
|
||||||
|
|
||||||
|
QRect rectText = option.rect.adjusted( 66, 20, -100, -8 );
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
rectText.adjust( 0, 1, 0, 0 );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
painter->drawText( rectText, descText );
|
||||||
painter->setPen( c );
|
painter->setPen( c );
|
||||||
|
painter->setFont( font );
|
||||||
|
|
||||||
if ( type != WelcomePlaylistModel::Station )
|
if ( type != WelcomePlaylistModel::Station )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user