[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Detecting when PopupApplet is iconified
From:       Rob Hasselbaum <rob () hasselbaum ! net>
Date:       2010-03-19 13:54:27
Message-ID: 579e15a11003190654ne3bc882wce29eb2d97743811 () mail ! gmail ! com
[Download RAW message or body]

On Thu, Mar 18, 2010 at 1:23 PM, Rob Hasselbaum <rob@hasselbaum.net> wrote:
> On Thu, Mar 18, 2010 at 10:56 AM, Sebastian Kügler <sebas@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@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic