[vlc-devel] commit: Qt iconView: font adjustments (Jakob Leben )

git version control git at videolan.org
Wed Jan 27 14:27:42 CET 2010


vlc | branch: master | Jakob Leben <jleben at videolan.org> | Wed Jan 27 14:25:23 2010 +0100| [38430d10a41d707226ae87c803aa450b15fd1979] | committer: 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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=38430d10a41d707226ae87c803aa450b15fd1979
---

 modules/gui/qt4/components/playlist/icon_view.cpp |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/icon_view.cpp b/modules/gui/qt4/components/playlist/icon_view.cpp
index 0c35264..dadd7d7 100644
--- a/modules/gui/qt4/components/playlist/icon_view.cpp
+++ b/modules/gui/qt4/components/playlist/icon_view.cpp
@@ -83,7 +83,11 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
     QString artist = qfu( input_item_GetArtist( currentItem->inputItem() ) );
 
     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();
     QRect titleRect = option.rect.adjusted( 1, ART_SIZE + 4, 0, -1 );
     titleRect.setHeight( fm.height() + 2 );
@@ -92,7 +96,8 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
                        QTextOption( Qt::AlignCenter ) );
 
     painter->setPen( text.lighter( 240 ) );
-    painter->setFont( QFont( "Verdana", 7 ) );
+    font.setItalic( false );
+    painter->setFont( font );
     fm = painter->fontMetrics();
     QRect artistRect = option.rect.adjusted( 1, ART_SIZE + 4 + titleRect.height(), -1, -1 );
 




More information about the vlc-devel mailing list