reposition the popup when the containment geometry changes
partially addresses 197522 (still have to manage cases where the view just moves or the screen resizes without resizing the containment) CCBUG:197522 svn path=/trunk/KDE/kdelibs/; revision=987082
This commit is contained in:
parent
fbb9239dda
commit
ed562d82dd
13
applet.cpp
13
applet.cpp
@ -1999,6 +1999,19 @@ QVariant Applet::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||
old->copyTo(d->mainConfig);
|
||||
old->deleteGroup();
|
||||
delete old;
|
||||
} else if (!d->isContainment) {
|
||||
Plasma::PopupApplet *pa = qobject_cast<Plasma::PopupApplet *>(this);
|
||||
if (!pa) {
|
||||
break;
|
||||
}
|
||||
//reconnect of popupapplets with new containment geometryChanged
|
||||
if (containment()) {
|
||||
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()));
|
||||
}
|
||||
}
|
||||
case ItemPositionChange:
|
||||
return (immutability() == Mutable || isContainment() || formFactor() == Horizontal || formFactor() == Vertical) ? value : pos();
|
||||
|
@ -600,6 +600,10 @@ void PopupAppletPrivate::dialogStatusChanged(bool status)
|
||||
|
||||
void PopupAppletPrivate::updateDialogPosition()
|
||||
{
|
||||
if (!dialog) {
|
||||
return;
|
||||
}
|
||||
|
||||
QGraphicsView *view = q->view();
|
||||
|
||||
if (!view) {
|
||||
|
@ -148,6 +148,7 @@ private:
|
||||
Q_PRIVATE_SLOT(d, void clearPopupLostFocus())
|
||||
Q_PRIVATE_SLOT(d, void dialogSizeChanged())
|
||||
Q_PRIVATE_SLOT(d, void dialogStatusChanged(bool))
|
||||
Q_PRIVATE_SLOT(d, void updateDialogPosition())
|
||||
|
||||
friend class Applet;
|
||||
friend class PopupAppletPrivate;
|
||||
|
Loading…
Reference in New Issue
Block a user