Re: Toolbar editor



>Can you summarize exactly what the addition is that you are
>proposing and how it relates to the other libegg components?

I'm proposing to add a way to build editable toolbars on the top of EggMenu.

What applications would need to do:

Create a EggEditableToolbar instance passing to it the EggMenuMerge they
are using to build their menus ui.
Provide an xml file with the available action and the default layout.
Call egg_editable_toolbar_edit to show the editor and put the toolbar in
edit mode (from a Edit->Customize toolbar, for example).

My implementation:

Toolbar build steps:

- load available actions and user custom layout (or default when there is
not one) in EggToolbarsGroup.
- Create an xml string from the data model
- merge it with EggMenuMerge (that will use EggToolbar to create the widgets)

Editing:
- When edit mode is activated, a dialog with the available actions is showed
and EggToolbar. I use egg_tool_item_set_use_drag_window to disable clicks
on the items and I set them as drag source.
- When the user drag items on the toolbar (from the toolbar itself, another
toolbar or the editor), I get the position the items has been dropped with
egg_toolbar_get_drop_index and I update the data model.
The selection data of the drag is just the EggAction name.
- The toolbar is recreated to match the new model (add new one/remove old
one, with EggMenuMerge).

I hope this is what you needed to know. Many of these things are just details
of current implementation, if they are not good I'd be happy to improve
them later.  But I think it would be good to have a base in libegg asap.
I hope the basic idea is fine though.

>Details - Before going into libegg, it probably should have
>the libxml dependency dealt with and also be reindented to
>match GTK+ style (pango/docs/TEXT/coding-style with 'gint'
>instead of 'int basically.)

Ok, I can deal with these if you like the idea in general.

Marco





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