[haiku-development] BControlLook scrollbar APIs

  • From: Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 22 Jul 2018 09:15:11 +0200

Hi there,

The API for BControlLook was changed recently. Instead of the old
piece-wise APIs for drawing the scrollbar background and buttons, there
is now a single DrawScrollbar call.

Unfortunately, this is a problem for WebPositive, because it manages its
own scrollbar logic. So it needs to knw where the scrollbar buttons are,
to do the right think when it gets a mouse click event in the scrollbar.

BScrollBar has its own _ButtonFor code, but in the current state this
would not work with a replacement BControlLook with different button
sizes (or no buttons at all, or…). The code in _ButtonFor would get out
of sync with the one in BControlLook.

We have two options here:
- Either revert to separate DrawButtons and DrawBackground methods, and
  let BScrollBar manage the layout. In this case, BControlLook cannot
  change the button layout of the scrollbar
- Or, let BControlLook tell BScrollBar where the buttons should be
  placed.

Sorry for the late comments, I had no time to review the BControlLook
version of https://review.haiku-os.org/#/c/haiku/+/300/ which spent just
6 hours on review before being +2 and merged by the same person (I would
prefer we avoid that, unless there is an emergency).

I will have to delay fixes to WebKit until a decision is made and the
new solution implemented. And meanwhile, I can't build WebKit because
the API has changed and the new one is not usable.

-- 
Adrien.

Other related posts: