Add PopupConstraintEvent, tells popupapplets (and applets with popups)
that the position has to be changed svn path=/trunk/KDE/kdelibs/; revision=1019486
This commit is contained in:
parent
9939b688c3
commit
acfd2a83fa
13
applet.cpp
13
applet.cpp
|
@ -2102,19 +2102,6 @@ QVariant Applet::itemChange(GraphicsItemChange change, const QVariant &value)
|
|||
delete old;
|
||||
}
|
||||
}
|
||||
|
||||
Plasma::PopupApplet *pa = qobject_cast<Plasma::PopupApplet *>(this);
|
||||
if (pa) {
|
||||
//reconnect of popupapplets with new containment geometryChanged
|
||||
if (c) {
|
||||
disconnect(containment(), SIGNAL(geometryChanged()), pa, SLOT(updateDialogPosition()));
|
||||
}
|
||||
|
||||
Plasma::Containment *cont = dynamic_cast<Containment*>(value.value<QGraphicsItem *>());
|
||||
if (cont) {
|
||||
connect(cont, SIGNAL(geometryChanged()), pa, SLOT(updateDialogPosition()));
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ItemPositionChange:
|
||||
|
|
6
plasma.h
6
plasma.h
|
@ -56,9 +56,11 @@ enum Constraint {
|
|||
/** application startup has completed */
|
||||
StartupCompletedConstraint = 32,
|
||||
/** the desktop context has changed */
|
||||
ContextConstraint = 64,
|
||||
ContextConstraint = 64,
|
||||
/** the position of the popup needs to be recalculated*/
|
||||
PopupConstraint = 128,
|
||||
AllConstraints = FormFactorConstraint | LocationConstraint | ScreenConstraint |
|
||||
SizeConstraint | ImmutableConstraint | ContextConstraint
|
||||
SizeConstraint | ImmutableConstraint | ContextConstraint | PopupConstraint
|
||||
};
|
||||
Q_DECLARE_FLAGS(Constraints, Constraint)
|
||||
|
||||
|
|
|
@ -342,6 +342,11 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)
|
|||
q->setMinimumSize(0,0);
|
||||
}
|
||||
}
|
||||
|
||||
if (dialog && constraints & Plasma::PopupConstraint) {
|
||||
updateDialogPosition();
|
||||
}
|
||||
|
||||
emit q->sizeHintChanged(Qt::PreferredSize);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user