diff --git a/popupapplet.cpp b/popupapplet.cpp index a4e16ae45..835646cea 100644 --- a/popupapplet.cpp +++ b/popupapplet.cpp @@ -350,6 +350,13 @@ void PopupApplet::hidePopup() } } +void PopupApplet::togglePopup() +{ + if (d->dialog && (formFactor() == Horizontal || formFactor() == Vertical)) { + d->dialog->setVisible(!d->dialog->isVisible()); + } +} + Plasma::PopupPlacement PopupApplet::popupPlacement() const { return d->popupPlacement; @@ -417,7 +424,7 @@ void PopupAppletPrivate::dialogSizeChanged() { //Reposition the dialog if (dialog) { - dialog->updateGeometry(); + //dialog->updateGeometry(); dialog->move(q->popupPosition(dialog->size())); KConfigGroup sizeGroup = q->config(); diff --git a/popupapplet.h b/popupapplet.h index f63694f93..1d6d619bd 100644 --- a/popupapplet.h +++ b/popupapplet.h @@ -82,13 +82,6 @@ public: */ virtual QGraphicsWidget *graphicsWidget(); - /** - * Shows the dialog showing the widget if the applet is in a panel. - * @arg displayTime the time in ms that the popup should be displayed, defaults to 0 which means - * always (until the user closes it again, that is). - */ - void showPopup(uint displayTime = 0); - /** * @return the placement of the popup relating to the icon */ @@ -109,6 +102,18 @@ public Q_SLOTS: */ void hidePopup(); + /** + * Shows the dialog showing the widget if the applet is in a panel. + * @arg displayTime the time in ms that the popup should be displayed, defaults to 0 which means + * always (until the user closes it again, that is). + */ + void showPopup(uint displayTime = 0); + + /** + * Toggles the popup. + */ + void togglePopup(); + protected: void mousePressEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);