Re: Toolbar editor



>I have been doing a bit of work on some of the basics needed for DnD
>toolbar editing in libegg.  I don't think my work overlaps with yours
>(yet), and in fact might integrate quite nicely with yours.
>
>I have some code to help use an EggToolbar as a drop target.  The first

>bit is code to draw the drop highlight as an insertion point at the
>closest boundary between two tool items.

I've still not been able to test it but iain told me it works with EphyEditableToolbar.
This is a major improvement.

>I also added a function to
>convert the drop (x,y) coordinates to a child index, which can be used

>in the drop handler:
>
>gint            egg_toolbar_get_drop_index  (EggToolbar      *toolbar,
>                                             gint             x,
>                                             gint             y);
>
>I have also added a function to turn on an input only window over the
>top of a EggToolItem, so that the EggToolItem can act as a drag source

>even if its children want to handle button press events (such as
>GtkButtons, GtkEntrys, etc):
>
>void egg_tool_item_set_use_drag_window (EggToolItem   *toolitem,
>                                        gboolean       use_drag_window);
>
>The drag window for each tool item would be turned on when toolbar
>customisation starts, and turned off again when customisation is
>finished.  I am not sure I like the name of this last API though (but
>can't think of something better at the moment).

Cool. I was forced to use grabs for this before, which is a pain.

>There is a test-drag.c program in libegg/toolbar can be used to test
>this drag code.  It simply makes the toolbar a drag target and the tool

>items drag sources, and adds a drop handler that reorders the tool >items.

In the weekend I should be able to update my code to use the new apis.
It looks like the only thing missing is to make EggSeparatorToolItem a real
widget (I think snorp is doing some work on it), so it can be a drag source
too.

Thanks !

Marco




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