]> git.sesse.net Git - vlc/commitdiff
Qt: adjust item text position in listView for better readability
authorJakob Leben <jleben@videolan.org>
Wed, 3 Mar 2010 17:58:58 +0000 (18:58 +0100)
committerJakob Leben <jleben@videolan.org>
Thu, 4 Mar 2010 08:13:06 +0000 (09:13 +0100)
modules/gui/qt4/components/playlist/icon_view.cpp

index 73c8a420255d0bfb72d5539d0eae4568ce89943b..f60ce0e9c12d1e0abee4b06e85a3ff21cb9c96b0 100644 (file)
@@ -266,7 +266,7 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
     if( !artistAlbum.isEmpty() )
     {
         textRect.setHeight( fm.height() );
-        textRect.moveBottom( option.rect.center().y() - 1 );
+        textRect.moveBottom( option.rect.center().y() - 2 );
     }
 
     //Draw children indicator
@@ -289,7 +289,8 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
         painter->setFont( f );
         fm = painter->fontMetrics();
 
-        textRect.moveTop( textRect.bottom() + 2 );
+        textRect.moveTop( textRect.bottom() + 4 );
+        textRect.setLeft( textRect.x() + 20 );
 
         painter->drawText( textRect,
                            fm.elidedText( artistAlbum, Qt::ElideRight, textRect.width() ),
@@ -304,7 +305,7 @@ QSize PlListViewItemDelegate::sizeHint ( const QStyleOptionViewItem & option, co
   QFont f;
   f.setBold( true );
   QFontMetrics fm( f );
-  int height = qMax( LISTVIEW_ART_SIZE, 2 * fm.height() + 2 ) + 6;
+  int height = qMax( LISTVIEW_ART_SIZE, 2 * fm.height() + 4 ) + 6;
   return QSize( 0, height );
 }