libbonoboui and pack-end toolbar items


the recent merge of the toolbar-rework branch in libbonoboui breaks
pack-end widgets, for example the nautilus throbber.

bonobo-ui-sync-toolbar.c 94:
#warning 'Pack End' behavior !?

The problem is that gtk and libbonoboui has different semantics. To
create a toolbar with a throbber in bonobo you could do:

<control name="ThrobberWrapper" behavior="pack-end"/>
<toolitem name="Back"/>
<toolitem name="Forward"/>

In gtk you could do:

Back - Forward - Expanded space only separator - Throbber

item = gtk_tool_button_new_from_stock (GTK_STOCK_BACK);
item = gtk_tool_button_new_from_stock (GTK_STOCK_FORWARD);
item = gtk_separator_tool_item_new ();
gtk_separator_tool_item_set_draw (item, FALSE);
gtk_tool_item_set_expand (item, TRUE);
item = gtk_tool_item_new ()
gtk_container_add (item, throbber);

I cant think of a good way to reimplement libbonobo-ui packends
using the gtk+ api. It would require to change the order of the
items and to insert a separator before the packends. That way it
would become impossible (or at least very very problematic)
to match nodes position with widgets position.

The alternative would be to extend bonobo a bit to mirror gtk

<toolitem name="Back"/>
<toolitem name="Forward"/>
<separator type="space" behavior="expandable"/>
<control name="ThrobberWrapper"/>

All that it would take is to support a type="space" attribute
for separator.

if (type && !strcmp (type, "space"))
           (GTK_SEPARATOR_TOOL_ITEM (tool_item), FALSE);

Obviously this would not be backward compatible :( Though we have
only one application (nautilus) using packends and fixing it would
be trivial.
The pack-end behavior could be deprecated: ipotetical applications
using it would still work fine, even if looking ugly.

Thoughts and better solutions would be greatly appreciated.

I posted a bug about it:


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