[haiku-commits] Re: haiku: hrev49614 - src/apps/mail

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: "haiku-commits@xxxxxxxxxxxxx" <haiku-commits@xxxxxxxxxxxxx>
  • Date: Thu, 10 Sep 2015 10:54:49 -0700

On Fri, Sep 4, 2015 at 8:36 AM, <axeld@xxxxxxxxxxxxxxxx> wrote:

e047b40a2fd1: Interface Kit: use different spacing constants.

* While this breaks binary compatibility with earlier Haiku releases,
use values that are less likely to clash with actual use cases.
* Specifically, using a negative spacing is one way to get rid of the
border of BScrollViews, to put them into a window neatly.
* Also, BControlLook now uses a switch to resolve them.
enum {
- B_USE_DEFAULT_SPACING = -2,
- B_USE_ITEM_SPACING = -3,
- B_USE_ITEM_INSETS = -3,
- B_USE_HALF_ITEM_SPACING = -4,
- B_USE_HALF_ITEM_INSETS = -4,
- B_USE_WINDOW_INSETS = -5,
- B_USE_WINDOW_SPACING = -5,
- B_USE_SMALL_INSETS = -6,
- B_USE_SMALL_SPACING = -6,
- B_USE_BIG_INSETS = -7,
- B_USE_BIG_SPACING = -7
+ B_USE_DEFAULT_SPACING = -1002,
+ B_USE_ITEM_SPACING = -1003,
+ B_USE_ITEM_INSETS = -1003,
+ B_USE_HALF_ITEM_SPACING = -1004,
+ B_USE_HALF_ITEM_INSETS = -1004,
+ B_USE_WINDOW_INSETS = -1005,
+ B_USE_WINDOW_SPACING = -1005,
+ B_USE_SMALL_INSETS = -1006,
+ B_USE_SMALL_SPACING = -1006,
+ B_USE_BIG_INSETS = -1007,
+ B_USE_BIG_SPACING = -1007
};

I’m afraid that -1002 is not large enough in magnitude. I could
imagine that someone might want to inset a box by more than 1002px so
this doesn’t go far enough. As long as we aren’t really concerned
about backwards compatibility here and can use any constants, can we
use something like MIN_INT + x instead?

Let’s say B_USE_BIG_SPACING = MIN_INT and then B_USE_SMALL_SPACING
uses MIN_INT + 1 etc. This will make it a lot less likely for there
to be conflicts between the named values and plain old negative
insets.

Other related posts: