[haiku-development] Re: Negative insets and BScroll{Bar|View}

  • From: "Adrien Destugues" <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 26 Aug 2015 08:35:08 +0000

26 août 2015 10:24 "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx> a écrit:

Hi there,

I'd like to hear your opinion about using negative insets to, for example,
cut off the border in
BScrollViews to neatly align them with the window borders.

This method is already used in our sources.

However, the B_USE_DEFAULT_SPACING and friends are in the range of -2 to -7,
so this method
currently only works for using -1 (ie. a fancy border cannot be cut this way,
as done in the
current Mail application -- which does not yet use the layout API, though).

So, this boils down to either change the constants to something less likely
to clash with real use
cases, or to forbid negative insets altogether.

The latter would require either adding specialized layouts for this case that
do the same, or
probably worse, some heuristics that automatically align scrollbars/views
when they are adjacent
the window borders in the current layout classes.

Is it safe to use hardcoded insets values for this? If we change the size of
the borders in the control look, things would not look right anymore. So maybe
it would make more sense to introduce a new constant, B_COLLAPSE_BORDER_SPACING
(which we could set to value -1 to keep binary compatibility with existing
apps) that would use the appropriate inset depending on the kind of border
(fancy or not) and the control look used?

--
Adrien.

Other related posts: