Commit 38430d10 authored by Jakob Leben's avatar Jakob Leben

Qt iconView: font adjustments

Keep application default font family.
Make Title italic.
Make both Title and Artist bold only if it is the current item.
parent 83717d05
...@@ -83,7 +83,11 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt ...@@ -83,7 +83,11 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
QString artist = qfu( input_item_GetArtist( currentItem->inputItem() ) ); QString artist = qfu( input_item_GetArtist( currentItem->inputItem() ) );
painter->setPen( text ); painter->setPen( text );
painter->setFont( QFont( "Verdana", 7, QFont::Bold ) ); QFont font;
font.setPointSize( 7 );
font.setItalic(true);
font.setBold( index.data( Qt::FontRole ).value<QFont>().bold() );
painter->setFont( font );
QFontMetrics fm = painter->fontMetrics(); QFontMetrics fm = painter->fontMetrics();
QRect titleRect = option.rect.adjusted( 1, ART_SIZE + 4, 0, -1 ); QRect titleRect = option.rect.adjusted( 1, ART_SIZE + 4, 0, -1 );
titleRect.setHeight( fm.height() + 2 ); titleRect.setHeight( fm.height() + 2 );
...@@ -92,7 +96,8 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt ...@@ -92,7 +96,8 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
QTextOption( Qt::AlignCenter ) ); QTextOption( Qt::AlignCenter ) );
painter->setPen( text.lighter( 240 ) ); painter->setPen( text.lighter( 240 ) );
painter->setFont( QFont( "Verdana", 7 ) ); font.setItalic( false );
painter->setFont( font );
fm = painter->fontMetrics(); fm = painter->fontMetrics();
QRect artistRect = option.rect.adjusted( 1, ART_SIZE + 4 + titleRect.height(), -1, -1 ); QRect artistRect = option.rect.adjusted( 1, ART_SIZE + 4 + titleRect.height(), -1, -1 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment