Re: Submenu arrow patch (Was: Re: Submenu navigation status?)



Nils Barth <nils_barth@post.harvard.edu> writes:

> Thus spake Owen Taylor:
> > I seem to remember that you
> > had another patch for switching the side of the arrow for
> > submenus. When I looked at it, you could get that to do strange things
> > with torn off menus and expose events, but it mostly looked pretty
> > reasonable. Do you have that or an updated version around somewhere?
> > (I probably can dig it up out of my mail if necessary.)
> 
> Yup -- I submitted that one before noticing the torn-off menus
> problem. Could you elaborate on the expose event strangeness? If you
> cover/expose it, it would point in the wrong direction?
> 
> Now that submenu nav is taken care of, I'll fix this up.
> I guess I need to include a re-calculation of the direction for when
> a torn-off menu is moved? Or every expose event?
> We'll see....

The problem was that the direction _was_ being calculated for every
expose event, so if you tore off the menu, moved it so
the arrows would pop up in the opposite direction, then did
a partial expose of the window, the exposed portions would be
drawn pointing one way, the unexposed portions pointing the
other way. (Expose half the arrow, get an hourglass shape)

The two solutions I can think of are:

 - Do the calculation when the window is moved. (You can do
   this by selecting on GDK_EVENT_CONFIGURE on the toplevel
   window), and queue a redraw when the direction changes.

 - When calculating the direction during the expose event,
   note if it changed from the previous time, and if so
   queue a redraw on the entire menu.

I'm not sure offhand which one is better. I'd guess maybe
the first might look a little less odd, though both will
seem a little odd to the user. 

Regards,
                                                Owen






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