allow checking if the applet has a popup showing associated with it. not BC, but we haven't released 4.2.0 yet and this is the least ucky way of doig it ;)
svn path=/trunk/KDE/kdelibs/; revision=902770
This commit is contained in:
parent
c1266d8689
commit
52ad594971
@ -1164,6 +1164,11 @@ KShortcut Applet::globalShortcut() const
|
||||
return KShortcut();
|
||||
}
|
||||
|
||||
bool Applet::isPopupShowing() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void Applet::addAssociatedWidget(QWidget *widget)
|
||||
{
|
||||
d->actions.addAssociatedWidget(widget);
|
||||
|
7
applet.h
7
applet.h
@ -508,6 +508,13 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
*/
|
||||
KShortcut globalShortcut() const;
|
||||
|
||||
/**
|
||||
* @return true is there is a popup assoiated with this Applet
|
||||
* showing, such as the dialog of a PopupApplet. May be reimplemented
|
||||
* for custom popup implementations.
|
||||
*/
|
||||
virtual bool isPopupShowing() const;
|
||||
|
||||
/**
|
||||
* associate actions with this widget, including ones added after this call.
|
||||
* needed to make keyboard shortcuts work.
|
||||
|
@ -66,6 +66,7 @@ void PopupApplet::setPopupIcon(const QIcon &icon)
|
||||
setLayout(0);
|
||||
setAspectRatioMode(d->savedAspectRatio);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -434,6 +435,11 @@ bool PopupApplet::isPassivePopup() const
|
||||
return d->passive;
|
||||
}
|
||||
|
||||
bool PopupApplet::isPopupShowing() const
|
||||
{
|
||||
return d->dialog && d->dialog->isVisible();
|
||||
}
|
||||
|
||||
PopupAppletPrivate::PopupAppletPrivate(PopupApplet *applet)
|
||||
: q(applet),
|
||||
icon(0),
|
||||
|
@ -100,6 +100,11 @@ public:
|
||||
*/
|
||||
bool isPassivePopup() const;
|
||||
|
||||
/**
|
||||
* @return true if the applet is popped up
|
||||
*/
|
||||
bool isPopupShowing() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
* Hides the popup.
|
||||
|
Loading…
Reference in New Issue
Block a user