[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bkdepimlibs=5D_akonadi=3A_Vertically_center_the_text?=
From:       Till Adam <till () kdab ! com>
Date:       2011-04-30 20:35:53
Message-ID: 20110430203553.E1E8FA60A4 () git ! kde ! org
[Download RAW message or body]

Git commit 1d7ca1a7d0bb0d56db4ad1c17ad3c5bd9c2e49dc by Till Adam.
Committed on 30/04/2011 at 22:35.
Pushed by tilladam into branch 'master'.

Vertically center the text in the folder tree cells.

Makes things look nicer with larger folder icon sizes.

M  +4    -4    akonadi/collectionstatisticsdelegate.cpp     

http://commits.kde.org/kdepimlibs/1d7ca1a7d0bb0d56db4ad1c17ad3c5bd9c2e49dc

diff --git a/akonadi/collectionstatisticsdelegate.cpp b/akonadi/collectionstatisticsdelegate.cpp
index adf5984..0085abc 100644
--- a/akonadi/collectionstatisticsdelegate.cpp
+++ b/akonadi/collectionstatisticsdelegate.cpp
@@ -279,9 +279,9 @@ void CollectionStatisticsDelegate::paint( QPainter *painter,
       unreadRect.setLeft( folderRect.right() );
 
       // Draw folder name and unread count
-      painter->drawText( folderRect, Qt::AlignLeft, folderName );
+      painter->drawText( folderRect, Qt::AlignLeft | Qt::AlignVCenter, folderName );
       painter->setPen( unreadColor );
-      painter->drawText( unreadRect, Qt::AlignLeft, unread );
+      painter->drawText( unreadRect, Qt::AlignLeft | Qt::AlignVCenter, unread );
     } else if ( option.decorationPosition == QStyleOptionViewItem::Top ) {
       // draw over the icon
       painter->setPen( unreadColor );
@@ -313,12 +313,12 @@ void CollectionStatisticsDelegate::paint( QPainter *painter,
       }
     }
 
-    painter->drawText( textRect, Qt::AlignRight, sumText );
+    painter->drawText( textRect, Qt::AlignRight | Qt::AlignVCenter, sumText );
 
     return;
   }
 
-  painter->drawText( textRect, option4.displayAlignment, text );
+  painter->drawText( textRect, option4.displayAlignment | Qt::AlignVCenter, text );
 }
 
 #include "collectionstatisticsdelegate.moc"

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic