← Back to team overview

unity-dev team mailing list archive

Re: [Ayatana-dev] Indicator datetime changes coming

 

Both of these can be solved the same way!  More below :)

On Fri, 2011-01-07 at 11:21 +0000, Karl Lattimer wrote:
> mpt has specified nicely what he'd like to see here;
> 
> https://wiki.ubuntu.com/TimeAndDate#Coming%20events
> 
> So the first item for discussion is, "The icon for the item should
> represent what kind of event it is, and for calendar events the icon
> should be tinted depending on which calendar it comes from."
> 
> In dbusmenu there's currently no way of specifying an icon colour but we
> do have something similar here;
> 
> https://bugs.launchpad.net/indicator-session/+bug/634003
> https://code.launchpad.net/~bilalakhtar/dbusmenu/fix-634003/+merge/34985
> 
> As far as I know the present situation is that symbolic icons won't be
> available in Natty, and then there's the issue of should the tint of the
> icon be a symbolic tint (from a list of colours), which would contradict
> the evolution UI which allows you to set an arbitrary colour.
>
> The second item is regarding the right aligned text in the menu items. 
> 
> As far as I can tell the only right aligned text that appears in the UI
> is the keyboard-shortcut (possibly out of my control) or the number of
> messages in the me menu (which doesn't match the desired style). 
> 
> However, I don't see how this is done in dbus menu looking at the
> available properties. I see here;
> http://bazaar.launchpad.net/~dbusmenu-team/dbusmenu/trunk/annotate/head:/libdbusmenu-glib/menuitem.h
> 
> I'm wondering if there's something I've missed somewhere which allows
> this to be done fairly easily.

One ability that the system indicators have that application indicators
don't have is the ability to define custom menu items.  What this
basically means is that you can create a new "type" of menu item that
does what ever you'd like.  For instance, the sound menu does this for
the player controls which couldn't be implemented using the standard
dbusmenu syntax.

Doing this is fairly easy, you just need to register the new type on the
indicator side (in this case indicator-datetime.c) using:

  dbusmenu_client_add_type_handler()

With something like "x-datetime-entry-type".  Then you can set the
properties to anything you like, including colors or right side text or
anything of the such.  Even though the messaging menu now has custom
drawing for it's right aligned text you can look at the previous version
and get some good hints from there:


http://bazaar.launchpad.net/~indicator-applet-developers/indicator-messages/trunk.0.2/annotate/head%3A/src/indicator-messages.c#L198

Hopefully that should be enough to get you started, ask more questions
as they come up!

		--Ted

Attachment: signature.asc
Description: This is a digitally signed message part


Follow ups

References