[vlc-commits] commit: Qt: adjust item text position in listView for better readability ( Jakob Leben )

git version control git at videolan.org
Thu Mar 4 10:34:08 CET 2010


vlc | branch: master | Jakob Leben <jleben at videolan.org> | Wed Mar  3 18:58:58 2010 +0100| [4f5a40108c2dd6c8dbe6758fe1eb2cdfb86b26d6] | committer: Jakob Leben 

Qt: adjust item text position in listView for better readability

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

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

diff --git a/modules/gui/qt4/components/playlist/icon_view.cpp b/modules/gui/qt4/components/playlist/icon_view.cpp
index 73c8a42..f60ce0e 100644
--- a/modules/gui/qt4/components/playlist/icon_view.cpp
+++ b/modules/gui/qt4/components/playlist/icon_view.cpp
@@ -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 );
 }
 



More information about the vlc-commits mailing list