[haiku-development] Re: BMenuBar scrolling support

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 29 Dec 2011 15:11:00 -0500

On Thu, Dec 29, 2011 at 2:34 PM, Ryan Leavengood <leavengood@xxxxxxxxx>wrote:

> It makes sense to always have it in BMenu instead of the developer
> trying to predict when it might be needed and then using the subclass.
>
> BUT I do agree with Stephan that we must try to avoid making the BMenu
> code more complex. I know it is outside of your scope of work, but
> extracting current BMenu code into inner classes at least (where it
> makes sense) would be very nice. This scrolling could be one example.

I don't understand what Stephan means about using an inner class. The
scroller views would be contained in classes of there own at least. The
code to do scrolling in BMenu would be cleaned up because it would
eliminate the private BMenuWindow class.


> I already have plans and half-done code to extract the shortcut
> management and processing into another class (though in that case it
> is mostly in BMenuItem and BWindow.) That is one example of specific,
> cohesive code which can be pulled into another utility class.
>
Perhaps I could look at the work you have done to get a better idea of how
to code this feature into a utility class.


> The part of BMenu which desperately needs extracting and refactoring
> (as Stephan and others have described in the past) is the menu opening
> and mouse/keyboard tracking code.

Sorry I wouldn't touch that code for this feature, maybe if I get ambitious
in the future I could tackle that.

I made a screencast (YouTube, sorry people without flash) of the scrolling
feature in Deskbar. It is incomplete but provides a reference for what I am
after.

http://youtu.be/6No0TfHR5Zk

Thanks,
John Scipione

Other related posts: