decent icon size

svn path=/trunk/KDE/kdelibs/; revision=1016957
This commit is contained in:
Marco Martin 2009-08-29 13:00:22 +00:00
parent 37f65858dc
commit 9ee071c5e3

View File

@ -366,7 +366,8 @@ void PushButton::paint(QPainter *painter,
QRectF rect = contentsRect(); QRectF rect = contentsRect();
if (!nativeWidget()->icon().isNull()) { if (!nativeWidget()->icon().isNull()) {
QPixmap iconPix = nativeWidget()->icon().pixmap(rect.height(), rect.height()); const iconSize = qMin(rect.width(), rect.height());
QPixmap iconPix = nativeWidget()->icon().pixmap(iconSize);
if (!isEnabled()) { if (!isEnabled()) {
KIconEffect *effect = KIconLoader::global()->iconEffect(); KIconEffect *effect = KIconLoader::global()->iconEffect();
iconPix = effect->apply(iconPix, KIconLoader::Toolbar, KIconLoader::DisabledState); iconPix = effect->apply(iconPix, KIconLoader::Toolbar, KIconLoader::DisabledState);