KNotificationAreaItem

Aaron J. Seigo aseigo at kde.org
Tue Apr 14 06:38:28 CEST 2009


hi..

this evening i ported KMix to use KNotificationAreaItem. it was very easy and 
it still works ;)

there are a few caveats:

* Activate has not positioning information

kmix tries to position the parentWindow (that borderless window with a slider 
and the Mixer button) to match up with the icon, as if it were a popup 
associated with it. we don't pass any geometry information back with the 
Activate() dbus call as we do with ContextMenu(int,int).

the questions i have are:

a) what to send across to help make this happen: x and y? a rect, emulating 
geometry()? a Direction? it would be nice is such popups could decide to 
center on the icon and even more so if they could appear outside of, e.g., 
panels; e.g. essentially the same thing as Corona::popupPosition does.

b) should a setHandleParentAsPopup(bool) method, which would internalize this 
behaviour and all it's intricacies? this way there could also be two code 
paths: one for the legacy mode and one for the new mode

c) is there someway to avoid having to support this at all? ;) kmix is using 
it rather .. uhm .. creatively. but it seems like a valid use case in that 
situation.


* activateRequested() signal - unused?

the activateRequested() signal doesn't seem to be used; is there a purpose for 
it?


* context menu handling

when using KSystemTrayIcon there are some additional items added (activate, 
quit). thinking about how to handle this, we could either do exactly what 
KSystemtrayIcon does when in "new and improved" mode and add these items after 
aboutToShow is called the first time or we could improve on this somewhat ;)

the thing with KSystemTrayIcon is that if you clear the menu after it's shown 
once, you won't get those actions in the menu anymore. nobody does this it 
seems, however., so that's all good so far. so maybe this is Good Enough(tm)

however, we could do thing a few different ways:

- provide a KActionCollection to register actions with, and then when the menu 
shows clear it and populate it with the context of the action collection plus 
our own

- provide an addAction / removeAction pair that would do more or less the same 
thing internally


* Tooltip -> ToolTip for consistency with the rest of the Qt/KDE api (already 
changed and commmitted to svn)

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090413/6ce76e79/attachment.sig 


More information about the Plasma-devel mailing list