Submenu navigation

Hi navigators-of-deep-submenus

In pursuit of big and better ways of improving submenus, I'd like to
Improve Submenu Navigation, as per GTK+ TODO list.

After futzing with a Mac for a while, I determined that they handle
navigation thusly:
(the attached picture should help)
When the mouse pointer leaves a menu item with a submenu, a little
triangle is drawn between the exit point (p0) and the lower left
corner of the submenu (p1), and the respective corner (p2)
(assuming that you exit the menuitem at the bottom and the submenu is
to your right, otherwise the upper-left, lower right, etc.)

While the mouse is in this triangle, the submenu stays up.
When the mouse leaves the triangle, or after a timeout (1/2 or so --
no stopwatch, sorry), the triangle disappears and the submenu

This is, I think, the Right Way (SM) of doing submenu navigation:
* If you leave the menuitem in the direction of the submenu, the
  submenu stays up.
* If you leave the menuitem NOT in the direction of the submenu,
  say if you're going up or down a menu item, the submenu dies.
* It's a very temporary arrangement, and thus only consumes resources
  when you're actually navigating.

I'm asking for feedback on two items:

(1) Do people agree that this is the right way of doing things?
    Concerns, suggestions?
(2) How should I implement this?

Re: (2)
Currently, I have modified gtkmenuitem.c:gtk_menu_shell_leave_notify()
so that when you leave a menuitem with a submenu, it determines what
kind of triangle should put up.
I'm thinking of also actually making the triangle popup here.
For the navigation triangle, I was thinking of deriving an object from
GtkBin and just drawing it (er, transparently), then monitoring it
cursor exits (in which case it dies);
cursor moving across the center diagonal (i.e., outside the triangle),
in which case it also dies;
timeout (in which case it yet again dies).

(a) This is actually a private object, since I can't imagine it being
useful outside submenu navigation -- is this a problem?
(b) I'm not too familiar with how GTK draws stuff/makes
windows/widgets internally -- is what I have described above

If anyone has suggestions/guidance, I'm welcome to it.

Public key:


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