Detecting when PopupApplet is iconified

Alessandro Diaferia alediaferia at gmail.com
Fri Mar 19 15:03:36 CET 2010


2010/3/19 Rob Hasselbaum <rob at hasselbaum.net>

> 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.
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel at kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
>

IIRC applets inside a panel are not reduced to icon if the panel is enough
big to host their "open-status". Please correct me if I'm wrong.

-- 
Alessandro Diaferia
KDE Developer
KDE e.V. member
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20100319/329ebadb/attachment.htm 


More information about the Plasma-devel mailing list