Message info
 
To:kde-commits@kde.org From:Daniele E. Domenichelli Subject:[ktp-accounts-kcm] src: Use decoration size to resize the button icon Date:Fri, 30 Mar 2012 17:58:08 +0200 (CEST)
 

Git commit e06e32fd2f8227bfba263aaf1fc1ff735960fbfa by Daniele E. Domenichelli.
Committed on 18/03/2012 at 02:50.
Pushed by ddomenichelli into branch 'master'.

Use decoration size to resize the button icon

M +6 -0 src/accounts-list-delegate.cpp

http://commits.kde.org/telepathy-accounts-kcm/e06e32fd2f8227bfba263aaf1fc1ff735960fbfa

diff --git a/src/accounts-list-delegate.cpp b/src/accounts-list-delegate.cpp
index 9c1ff3c..e6e9425 100644
--- a/src/accounts-list-delegate.cpp
+++ b/src/accounts-list-delegate.cpp
@@ -151,6 +151,12 @@ void AccountsListDelegate::updateItemWidgets(const QList<QWidget *> widgets, con
// changeIconButton
changeIconButton->setIcon(accountIcon);
changeIconButton->setAccount(account);
+ // At the moment (KDE 4.8.1) decorationSize is not passed from KWidgetItemDelegate
+ // through the QStyleOptionViewItem, therefore we leave default size unless
+ // the user has a more recent version.
+ if (option.decorationSize.width() > -1) {
+ changeIconButton->setButtonIconSize(option.decorationSize.width());
+ }

int changeIconButtonLeftMargin = checkboxLeftMargin + checkbox->width();
int changeIconButtonTopMargin = (outerRect.height() - changeIconButton->height()) / 2;