[vlc-commits] commit: Qt4: don't draw background on nodes in icon_view by default ( Ilkka Ollakka )

git at videolan.org git at videolan.org
Mon Jun 28 10:57:14 CEST 2010


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Mon Jun 28 11:33:48 2010 +0300| [87d96eea33644f68c511c4d9f5bc0179ff6f2c9c] | committer: Ilkka Ollakka 

Qt4: don't draw background on nodes in icon_view by default

Only draw background if it's parent of current item, hopefully makes the
iconview in tree-mode littlebit cleaner in UI-wise (well, actually want to
see what others like it in this way). Also should make easier/faster to spot
the current items parent from iconview mode in tree-mode.

Also draw background-rect with rounded corners.

Feel free to revert/worship/point fingers/express opinions on this commit.

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

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

diff --git a/modules/gui/qt4/components/playlist/icon_view.cpp b/modules/gui/qt4/components/playlist/icon_view.cpp
index 6a01d6e..edf68ef 100644
--- a/modules/gui/qt4/components/playlist/icon_view.cpp
+++ b/modules/gui/qt4/components/playlist/icon_view.cpp
@@ -164,15 +164,17 @@ void PlIconViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
     //Draw children indicator
     if( !index.data( PLModel::IsLeafNodeRole ).toBool() )
     {
-        painter->setOpacity( 0.75 );
         QRect r( option.rect );
         r.setSize( QSize( 25, 25 ) );
         r.translate( 5, 5 );
         if( index.data( PLModel::IsCurrentsParentNodeRole ).toBool() )
-            painter->fillRect( r, option.palette.color( QPalette::Highlight ) );
-        else
-            painter->fillRect( r, option.palette.color( QPalette::Mid ) );
-        painter->setOpacity( 1.0 );
+        {
+            painter->setOpacity( 0.75 );
+            QPainterPath nodeRectPath;
+            nodeRectPath.addRoundedRect( r, 4, 4 );
+            painter->fillPath( nodeRectPath, option.palette.color( QPalette::Highlight ) );
+            painter->setOpacity( 1.0 );
+        }
         QPixmap dirPix( ":/type/node" );
         QRect r2( dirPix.rect() );
         r2.moveCenter( r.center() );



More information about the vlc-commits mailing list