From 07444819b7e60653edcf42cad259a9a2c4baa926 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 15 Dec 2010 14:35:11 +0000 Subject: [PATCH] move the size adjustment in a private member svn path=/trunk/KDE/kdelibs/; revision=1206703 --- extenders/extender.cpp | 9 +++++++-- extenders/extendergroup.cpp | 4 ++-- private/extender_p.h | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/extenders/extender.cpp b/extenders/extender.cpp index e03536d47..74a6d2397 100644 --- a/extenders/extender.cpp +++ b/extenders/extender.cpp @@ -514,7 +514,7 @@ void Extender::itemAddedEvent(ExtenderItem *item, const QPointF &pos) d->updateEmptyExtenderLabel(); d->updateBorders(); - resize(d->mainWidget->effectiveSizeHint(Qt::PreferredSize)); + d->adjustSize(); } void Extender::itemRemovedEvent(ExtenderItem *item) @@ -541,7 +541,7 @@ void Extender::itemRemovedEvent(ExtenderItem *item) static_cast(d->scrollWidget)->updateGeometry(); updateGeometry(); - resize(d->mainWidget->effectiveSizeHint(Qt::PreferredSize)); + d->adjustSize(); } void Extender::itemHoverEnterEvent(ExtenderItem *item) @@ -915,6 +915,11 @@ void ExtenderPrivate::setDisabledBordersHint(const FrameSvg::EnabledBorders bord } } +void ExtenderPrivate::adjustSize() +{ + q->resize(mainWidget->effectiveSizeHint(Qt::PreferredSize)); +} + bool Extender::isEmpty() const { //It's empty if it doesn't have items or has only group that are empty and autohide diff --git a/extenders/extendergroup.cpp b/extenders/extendergroup.cpp index 7e4714632..fced46c57 100644 --- a/extenders/extendergroup.cpp +++ b/extenders/extendergroup.cpp @@ -336,7 +336,7 @@ void ExtenderGroupPrivate::addItemToGroup(Plasma::ExtenderItem *item, const QPoi static_cast(q->extender()->d->scrollWidget)->updateGeometry(); } - q->extender()->resize(q->extender()->effectiveSizeHint(Qt::PreferredSize)); + q->extender()->d->adjustSize(); } } @@ -355,7 +355,7 @@ void ExtenderGroupPrivate::removeItemFromGroup(Plasma::ExtenderItem *item) static_cast(childsWidget)->updateGeometry(); static_cast(q->extender()->d->scrollWidget)->updateGeometry(); - q->extender()->resize(q->extender()->effectiveSizeHint(Qt::PreferredSize)); + q->extender()->d->adjustSize(); } } diff --git a/private/extender_p.h b/private/extender_p.h index 8acb23379..b58b85a14 100644 --- a/private/extender_p.h +++ b/private/extender_p.h @@ -78,6 +78,7 @@ class ExtenderPrivate void setPositionFromDragPosition(const QPointF &pos); ExtenderGroup *findGroup(const QString &name) const; void setDisabledBordersHint(const FrameSvg::EnabledBorders borders); + void adjustSize(); Extender *q;