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

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 26 Aug 2015 11:52:54 +0200

On 26.08.2015 10:27, Axel Dörfler wrote:

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.

Or use something like this to avoid breaking binary compatibility:

#define B_DEFINE_NEGATIVE_INSET(x) ((x) - 1000)
#define B_IS_NEGATIVE_INSET(x) ((x) < -1000)
#define B_GET_NEGATIVE_INSET(x) ((x) + 1000)

CU, Ingo


Other related posts: