From 2d1fe7b1382bbad4d8b1997b52905fdd2a56165c Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 21 May 2010 02:03:19 +0000 Subject: [PATCH] don't jiggle BUG:202949 svn path=/trunk/KDE/kdelibs/; revision=1129021 --- widgets/iconwidget.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/widgets/iconwidget.cpp b/widgets/iconwidget.cpp index 10c8cb771..549085f11 100644 --- a/widgets/iconwidget.cpp +++ b/widgets/iconwidget.cpp @@ -1211,8 +1211,10 @@ void IconWidget::setText(const QString &text) QStyleOptionGraphicsItem styleoption; d->layoutIcons(&styleoption); } - resize(sizeFromIconSize(d->iconSize.width())); updateGeometry(); + if (!parentWidget() || !parentWidget()->layout()) { + resize(preferredSize()); + } } QString IconWidget::text() const @@ -1230,8 +1232,10 @@ void IconWidget::setInfoText(const QString &text) QStyleOptionGraphicsItem styleoption; d->layoutIcons(&styleoption); } - resize(sizeFromIconSize(d->iconSize.width())); updateGeometry(); + if (!parentWidget() || !parentWidget()->layout()) { + resize(preferredSize()); + } } QString IconWidget::infoText() const