Notify applets when their LocationConstraint has changed. Also, don't bother
emitting geometryChanged() and doing an update() if the geometry hasn't actually changed. svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=751543
This commit is contained in:
parent
c0bba16e87
commit
55437fafb6
17
applet.cpp
17
applet.cpp
@ -1300,6 +1300,8 @@ QVariant Applet::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||
|
||||
void Applet::setGeometry(const QRectF& geometry)
|
||||
{
|
||||
Plasma::Constraints updatedConstraints(0);
|
||||
|
||||
if (geometry.size().width() > 0 && geometry.size().height() > 0 && size() != geometry.size()) {
|
||||
prepareGeometryChange();
|
||||
qreal width = qBound(minimumSize().width(), geometry.size().width(), maximumSize().width());
|
||||
@ -1315,12 +1317,19 @@ void Applet::setGeometry(const QRectF& geometry)
|
||||
managingLayout()->invalidate();
|
||||
}
|
||||
|
||||
updateConstraints(Plasma::SizeConstraint);
|
||||
updatedConstraints |= Plasma::SizeConstraint;
|
||||
}
|
||||
|
||||
setPos(geometry.topLeft());
|
||||
emit geometryChanged();
|
||||
update();
|
||||
if (geometry.topLeft() != pos()) {
|
||||
setPos(geometry.topLeft());
|
||||
updatedConstraints |= Plasma::LocationConstraint;
|
||||
}
|
||||
|
||||
if (updatedConstraints) {
|
||||
updateConstraints(updatedConstraints);
|
||||
emit geometryChanged();
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void Applet::setIsContainment(bool isContainment)
|
||||
|
Loading…
Reference in New Issue
Block a user