Re: Toolbar editor
- From: James Henstridge <james daa com au>
- To: mpeseng tin it
- Cc: gtk-devel-list gnome org, iain prettypeople org
- Subject: Re: Toolbar editor
- Date: Wed, 26 Mar 2003 23:37:27 +0800
mpeseng tin it wrote:
Hi,
is there any plan to have a toolbar editor based on EggMenu in libegg ?
I think it would be a good idea:
- useful for the apps ported to the new toolbar api (at least epiphany,
marlin and anjuta already need it). Some of them are already starting their
own implementation or cut/paste epiphany code. A common place to develop
it would avoid the mess.
- help to design an interface that can work for most apps
- find and fix EggMenu/EggToolbar problems regard editing before they are
included in gtk
In epiphany we started working on a drag and drop based implementation,
you can see it at:
http://www.prettypeople.org/~iain/tbe-iain-5.png
I think it's the more usable approach but it would need some work to make
it accessible, one reason more to share the code.
Current design is based on two objects.
EphyToolbarsGroup:
The model. All EditableToolbar instance share it.
EphyEditableToolbar :
The view. It has an _edit api that shows the dialog.
We will need a way to add support for custom drag and drop types and a way
for application to create EggActions for them (we use it for bookmarks in
epiphany).
You can see the code in epiphany module (gnome cvs)
lib/widgets/ephy-editable-toolbar.c/h
lib/widgets/ephy-toolbars-group.c/h
If there is interest to have this in libegg, me and iain could mantain it,
we need to work on it for marlin and epiphany anyway.
I'd be happy to try to address eventual design problems.
Let me know.
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 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).
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.
James.
--
Email: james daa com au
WWW: http://www.daa.com.au/~james/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]