From kde-commits Sat Apr 30 20:35:53 2011 From: Till Adam Date: Sat, 30 Apr 2011 20:35:53 +0000 To: kde-commits Subject: =?utf-8?q?=5Bkdepimlibs=5D_akonadi=3A_Vertically_center_the_text?= Message-Id: <20110430203553.E1E8FA60A4 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=130419579422516 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"