move the size adjustment in a private member

svn path=/trunk/KDE/kdelibs/; revision=1206703
This commit is contained in:
Marco Martin 2010-12-15 14:35:11 +00:00
parent 03a4645d5a
commit 07444819b7
3 changed files with 10 additions and 4 deletions

View File

@ -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<QGraphicsLayoutItem *>(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

View File

@ -336,7 +336,7 @@ void ExtenderGroupPrivate::addItemToGroup(Plasma::ExtenderItem *item, const QPoi
static_cast<QGraphicsLayoutItem *>(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<QGraphicsLayoutItem *>(childsWidget)->updateGeometry();
static_cast<QGraphicsLayoutItem *>(q->extender()->d->scrollWidget)->updateGeometry();
q->extender()->resize(q->extender()->effectiveSizeHint(Qt::PreferredSize));
q->extender()->d->adjustSize();
}
}

View File

@ -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;