playground/base/plasma/applets/systray-refactor/protocols/plasmoid

Jason Stubbs jasonbstubbs at gmail.com
Tue Sep 23 02:36:30 CEST 2008


Aaron J. Seigo wrote:
> On Saturday 20 September 2008, Sebastian Kügler wrote:
>>>> The applets should also be told about the formfactor by the systray
>>>> applet
>>>>
>>>  > (I think horizontal makes sense in almost all cases).
>>>
>>> This will require SystemTray::Task to return something other than a
>>> QGraphicsWidget* as the design intentionally allows a Task to be
>>> displayed in several trays and each may have a different orientation.
> 
> ... this won't work for all Protocols. eventually, all Protocols will be nice 
> in this way, but ... not all will. in any case, you can't have a 
> QGraphicsWiget* in more than one place on screen without manipulating it's 
> painting behind the scenes, but then you'll lose when you different layouts 
> anyways.
> 
> so if the goal is to have the same Task in multiple places on screen, you'll 
> need to do something a bit different.

This is already accounted for. The protocol just needs to return a new 
QGraphicsWidget each time. What I'm saying above is that there's nothing 
in the QGraphicsWidget API about orientation, hence there's no way to 
tell the returned QGraphicsWidget what orientation it should be.

Hmm.. Actually, asking the Task object for a widget of a certain 
orientation should be enough. eg. task->widget(Qt::Horizontal)

> personally, i think it makes more sense to have each tray simply have it's own 
> collection of Tasks and rely on the protocol to support multiplexing (e.g. in 
> an IPC based protocol, each Task would draw off of the same information; in a 
> plasmoid based protocol, each Task would draw off the same list of applets and 
> perhaps even the same configuraton objects for them) .. support in the Protocol 
> is required anyways to make this work, so just leave it up to the Protocol in 
> the first place would be my thought.

This is what the returned QGraphicsWidget subclass should do in my design.

>> Then we should have different applets displaying -- applets are meant to be
>> this visualisation. The applet decides based on size and formfactor how to
>> display.
> 
> right

Currently, both the fdo protocol and the plasmoid protocol specify that 
there should be no more than one widget per task. Should the plasmoids 
applet be able to display a task in separate areas of the screen, it 
would need to be different applets or some fancy 
QGraphicsProxyGraphicsWidget. ;)

Also, what is the orientation when on the desktop? If horizontal, should 
it still be horizontal on displays that have a larger height than width?

--
Jason Stubbs


More information about the Plasma-devel mailing list