FrapMenu menu/item ordering

Stefan Stuhr xfce4devlist at sstuhr.dk
Wed Feb 21 21:42:13 CET 2007


ons, 21 02 2007 kl. 21:28 +0100, skrev Jannis Pohlmann:
> On Wed, 21 Feb 2007 20:42:36 +0100, Stefan Stuhr wrote:
> > I will admit that I don't know the fd.org menu standard, but if the
> > implementation in GNOME follows the standard (I do believe that it
> > does), then the order does matter - and not necessary a sorted order.
> 
> See below. BTW, what GNOME does is not relevant to me. I think their
> implementation sucks (internally), so I prefere to concentrate on the
> specification itself.
> 
> > E.g. in the GNOME menu editor, alacarte, it's possible to manually
> > move menu items around (be it menu directories/submenus, menu
> > entries, or separators), and place them in a manual, non-sorted order
> > of choice.
> 
> I don't know how they do this, but the spec only mentions alphabetical
> order in relation to menu layouts (which have not been implemented in
> FrapMenu yet).


>From the spec[1]:

<Layout>
        
        The <Layout> element is an optional part of this specification.
        Implementations that do not support the <Layout> element should
        preserve any <Layout> elements and their contents as far as
        possible. Each <Menu> may optionally contain a <Layout> element.
        If multiple elements appear then only the last such element is
        relevant. The purpose of this element is to offer suggestions
        for the presentation of the menu. If a menu does not contain a
        <Layout> element or if it contains an empty <Layout> element
        then the default layout should be used. The <Layout> element may
        contain <Filename>, <Menuname>, <Separator> and <Merge>
        elements. The <Layout> element defines a suggested layout for
        the menu starting from top to bottom. References to desktop
        entries that are not contained in this menu as defined by the
        <Include> and <Exclude> elements should be ignored. References
        to sub-menus that are not directly contained in this menu as
        defined by the <Menu> elements should be ignored. 

[...]

<Separator>
        
        This element may only appear as a child of a <Layout> or
        <DefaultLayout> menu. It indicates a suggestion to draw a visual
        separator at this point in the menu. <Separator> elements at the
        start of a menu, at the end of a menu or that directly follow
        other <Separator> elements may be ignored. 


As far as I can tell, if FrapMenu is going to support <Layout> (which I
can now see is an optional part of the spec) in the future, then it will
have to support manually defined order of items. Otherwise, <Separator>
just wouldn't make sense.


[1]: http://standards.freedesktop.org/menu-spec/latest/ar01s04.html#menu-file-elements

> Regards,
>   Jannis

Stefan




More information about the Xfce4-dev mailing list