diff --git a/darwin/autolayout.m b/darwin/autolayout.m index 64f2be93..95116ba2 100644 --- a/darwin/autolayout.m +++ b/darwin/autolayout.m @@ -51,6 +51,10 @@ void layoutSingleView(NSView *superview, NSView *subview, int margined, NSString [superview removeConstraints:[superview constraints]]; + // don't hug if needed + setHorzHuggingPri(subview, NSLayoutPriorityDefaultLow); + setVertHuggingPri(subview, NSLayoutPriorityDefaultLow); + margin = 0; if (margined) margin = 20; // TODO named constant diff --git a/darwin/box.m b/darwin/box.m index be190646..f6649a2c 100644 --- a/darwin/box.m +++ b/darwin/box.m @@ -2,11 +2,10 @@ #import "uipriv_darwin.h" // TODOs: -// - page 2 is growable but the wrong control grows -// - tab on page 2 is glitched -// - separators on page 4 have variable padding after them +// - tab on page 2 is glitched initially // - 10.8: if we switch to page 4, then switch back to page 1, check Spaced, and go back to page 4, some controls (progress bar, popup button) are clipped on the sides // - calling layoutSubtreeIfNeeded on a superview of the box will cause the following intrinsic content size thing to not work until the window is resized in the primary direction; this is bad if we ever add a Splitter... +// - moving around randomly through the tabs does this too // the default is to have no intrinsic content size; this wreaks havoc with nested no-stretchy boxes fighting over which box gets the remaining space // let's use a 0x0 intrinsic size instead; that seems to fix things diff --git a/darwin/fontbutton.m b/darwin/fontbutton.m index 35224cb2..87026643 100644 --- a/darwin/fontbutton.m +++ b/darwin/fontbutton.m @@ -2,6 +2,7 @@ #import "uipriv_darwin.h" // TODO drag and drop fonts? what other interactions does NSColorWell allow that we can do for fonts? +// TODO when closing the window, deactivate the current button @interface fontButton : NSButton { uiFontButton *libui_b; diff --git a/darwin/spinbox.m b/darwin/spinbox.m index 1ddff150..409bd5e0 100644 --- a/darwin/spinbox.m +++ b/darwin/spinbox.m @@ -82,12 +82,12 @@ struct uiSpinbox { [self addConstraint:mkConstraint(self->stepper, NSLayoutAttributeTop, NSLayoutRelationEqual, self, NSLayoutAttributeTop, - 1, 0, + 1, -1, // TODO make sure this is right @"uiSpinbox top edge stepper")]; [self addConstraint:mkConstraint(self->stepper, NSLayoutAttributeBottom, NSLayoutRelationEqual, self, NSLayoutAttributeBottom, - 1, 0, + 1, -1, // TODO make sure this is right @"uiSpinbox bottom edge stepper")]; [self addConstraint:mkConstraint(self->tf, NSLayoutAttributeTrailing, NSLayoutRelationEqual,