diff --git a/popupapplet.cpp b/popupapplet.cpp index d6a01c599..cd115a86f 100644 --- a/popupapplet.cpp +++ b/popupapplet.cpp @@ -61,7 +61,7 @@ PopupApplet::PopupApplet(QObject *parent, const QVariantList &args) int iconSize = IconSize(KIconLoader::Desktop); resize(iconSize, iconSize); disconnect(this, SIGNAL(activate()), (Applet*)this, SLOT(setFocus())); - connect(this, SIGNAL(activate()), this, SLOT(togglePopup())); + connect(this, SIGNAL(activate()), this, SLOT(appletActivated())); setAcceptDrops(true); } @@ -430,6 +430,12 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints) emit q->sizeHintChanged(Qt::PreferredSize); } +void PopupAppletPrivate::appletActivated() +{ + q->setStatus(Plasma::NeedsAttentionStatus); + q->showPopup(); +} + void PopupApplet::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (!d->icon && !d->popupLostFocus && event->buttons() == Qt::LeftButton) { @@ -772,7 +778,11 @@ void PopupAppletPrivate::updateDialogPosition() QSize s = dialog->size(); QPoint pos = view->mapFromScene(q->scenePos()); - pos = corona->popupPosition(q, s); + if (!q->containment() || view == q->containment()->view()) { + pos = corona->popupPosition(q, s); + } else { + pos = corona->popupPosition(q->parentItem(), s); + } bool reverse = false; if (q->formFactor() == Plasma::Vertical) { diff --git a/popupapplet.h b/popupapplet.h index 590fee37a..5218c5eda 100644 --- a/popupapplet.h +++ b/popupapplet.h @@ -168,6 +168,7 @@ private: Q_PRIVATE_SLOT(d, void dialogSizeChanged()) Q_PRIVATE_SLOT(d, void dialogStatusChanged(bool)) Q_PRIVATE_SLOT(d, void updateDialogPosition()) + Q_PRIVATE_SLOT(d, void appletActivated()) friend class Applet; friend class AppletPrivate; diff --git a/private/popupapplet_p.h b/private/popupapplet_p.h index 9bf88feaa..3057857c5 100644 --- a/private/popupapplet_p.h +++ b/private/popupapplet_p.h @@ -43,6 +43,7 @@ public: void popupConstraintsEvent(Plasma::Constraints constraints); void checkExtenderAppearance(Plasma::FormFactor f); KConfigGroup popupConfigGroup(); + void appletActivated(); PopupApplet *q; Plasma::IconWidget *icon;