[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ayatana] Unity Lenses API: View customization



On 11/22/2011 11:11 AM, Owas Lone wrote:
Hello,

With all the cool lensed being made by the likes of David Callé (are
you here??), I've felt the the lenses need should allow the the
programmer to drop to nux and render the view himself. Seriously,
everything doesn't fit in well with an icon+label grid view. Some
lenses could really use a low level api to handle the drawing of nux
elements in the view. If that is more of a danger to consistency, it
should be possible adjust the grid layout like Gtk and the
elements/icons/tiles (what is the term for them?) should be
customizable too like Icon only/Text only/Both.


Hey Owas,

Good news :-) There are some upgrades to the rendering system scheduled for Precise.

Firstly let's get the terminology in place. Lenses in Unity fit into a kind of Model-View-Controller pattern. The lens would be the model and the controller, and Unity is regarded as a "dumb view" that you can talk to in a declarative way. Concretely, you have a set of tables that you fill out with appropriate data. Unity then read what kind of "renderer" you want for your results.

Right now we have two renderers. The default renderer (see fx.apps- or files lenses) and the horizontal renderer (which is used in fx. gwibber).

Right now it is not possible to tweak the behaviour of renderers, as you also point out. Under the hood though, there is actually provisions for setting "hints" on the renderer that unity can pick up an use to tweak the rendering. They are not wired up currently though, but someone could do that - hint hint ;-)

Currently there are plans aloft to add a new type of renderer as well, namely a "list renderer" which will use horizontal tiles that span the entire width of the dash. There are also plans to add some more funky renderers with some 3d effects, but they are a bit up in the air right now.

The thing is that adding renderers is not entirely trivial. And can easily spoil the user experience if not done correctly. Firstly we need both unity3d and unity2d versions of the renderers. Secondly, in u3d the renderer is running inside the Unity process, thus inside the window manager. Running inside the wm means that one must be *very* careful at what they're doing.

All that said, this is definitely an area where the community can help out. People interested in helping to write renderers should ping gord, njpatel, and/or Kaleo on #ayatana.

Cheers,
Mikkel