Detecting when PopupApplet is iconified
Rob Hasselbaum
rob at hasselbaum.net
Fri Mar 19 14:54:27 CET 2010
On Thu, Mar 18, 2010 at 1:23 PM, Rob Hasselbaum <rob at hasselbaum.net> wrote:
> On Thu, Mar 18, 2010 at 10:56 AM, Sebastian Kügler <sebas at kde.org> wrote:
>>
>> You can, because you can find out if it's on the desktop by calling formFactor().
>>
>
> Ahh, OK, so if the form factor is either Horizontal or Vertical, it's guaranteed that the applet is a panel icon?
Here is the code I ended up with. Seems to work:
bool MyApplet::isOpen() const {
if (formFactor() == Plasma::Horizontal || formFactor() ==
Plasma::Vertical) {
return isPopupShowing();
} else {
return true;
}
}
Any chance of getting this (or something like it) added to the
PopupApplet API? Seems generally useful, since it gives applets an
opportunity to reduce their resource footprint when they're not
displayed.
More information about the Plasma-devel
mailing list