diff --git a/darwin/box.m b/darwin/box.m index c41ab6f1..25116c5e 100644 --- a/darwin/box.m +++ b/darwin/box.m @@ -95,9 +95,9 @@ struct uiBox { self->secondaryOrientation = NSLayoutConstraintOrientationVertical; } - // TODO default high? - self->horzHuggingPri = NSLayoutPriorityRequired; - self->vertHuggingPri = NSLayoutPriorityRequired; + // TODO required? + self->horzHuggingPri = NSLayoutPriorityDefaultHigh; + self->vertHuggingPri = NSLayoutPriorityDefaultHigh; } return self; } @@ -132,7 +132,7 @@ struct uiBox { [self removeConstraints:self->inBetweens]; [self->inBetweens removeAllObjects]; [self removeConstraint:self->last]; - [self removeConstraint:self->lastHugging]; + [self removeConstraint:self->last2]; [self removeConstraints:self->otherConstraints]; [self->otherConstraints removeAllObjects]; } @@ -300,7 +300,7 @@ struct uiBox { // TODO will default high work? uiDarwinControlSetRealHuggingPriority(uiDarwinControl(bc.c), NSLayoutPriorityRequired, self->primaryOrientation); // make sure controls don't hug their secondary direction so they fill the width of the view - uiDarwinControlSetRealHuggingPriority(uiDarwinControl(bc.c), NSLayoutPriorityDefaultLow, self->secondaryOrientation); + uiDarwinControlSetRealHuggingPriority(uiDarwinControl(bc.cc), NSLayoutPriorityDefaultLow, self->secondaryOrientation); [self->children addObject:bc]; [bc release]; // we don't need the initial reference now diff --git a/darwin/group.m b/darwin/group.m index 1fbce07b..663c58cd 100644 --- a/darwin/group.m +++ b/darwin/group.m @@ -70,9 +70,27 @@ static void uiGroupSyncEnableState(uiDarwinControl *c, int enabled) uiDarwinControlDefaultSetSuperview(uiGroup, box) -static void uiGroupSetRealHuggingPriority(uiDarwinControl *c, NSLayoutPriority priority, NSLayoutConstraintOrientation orientation) +static BOOL uiGroupChildrenShouldAllowSpaceAtTrailingEdge(uiDarwinControl *c) { - // TODO + uiControl *parent; + + // TODO figure out why this works + parent = uiControlParent(uiControl(c)); + if (parent != NULL) + return uiDarwinControlChildrenShouldAllowSpaceAtTrailingEdge(uiDarwinControl(parent)); + // always allow growth if not + return YES; +} + +static BOOL uiGroupChildrenShouldAllowSpaceAtBottom(uiDarwinControl *c) +{ + uiControl *parent; + + parent = uiControlParent(uiControl(c)); + if (parent != NULL) + return uiDarwinControlChildrenShouldAllowSpaceAtBottom(uiDarwinControl(parent)); + // always allow growth if not + return YES; } static void groupRelayout(uiGroup *g) diff --git a/darwin/tab.m b/darwin/tab.m index 8ceb7d4f..3138b890 100644 --- a/darwin/tab.m +++ b/darwin/tab.m @@ -56,9 +56,16 @@ uiDarwinControlDefaultSyncEnableState(uiTab, tabview) uiDarwinControlDefaultSetSuperview(uiTab, tabview) -static void uiTabSetRealHuggingPriority(uiDarwinControl *c, NSLayoutPriority priority, NSLayoutConstraintOrientation orientation) +static BOOL uiTabChildrenShouldAllowSpaceAtTrailingEdge(uiDarwinControl *c) { - // TODO + // always allow growth + return YES; +} + +static BOOL uiTabChildrenShouldAllowSpaceAtBottom(uiDarwinControl *c) +{ + // always allow growth + return YES; } static void tabRelayout(uiTab *t) diff --git a/darwin/window.m b/darwin/window.m index 6c879ba4..4b2248f4 100644 --- a/darwin/window.m +++ b/darwin/window.m @@ -141,9 +141,16 @@ static void uiWindowSetSuperview(uiDarwinControl *c, NSView *superview) // TODO } -static void uiWindowSetRealHuggingPriority(uiDarwinControl *c, NSLayoutPriority priority, NSLayoutConstraintOrientation orientation) +static BOOL uiWindowChildrenShouldAllowSpaceAtTrailingEdge(uiDarwinControl *c) { - // do nothing; uiWindow children never hug (to maintain parity with other OSs) + // always allow growth + return YES; +} + +static BOOL uiWindowChildrenShouldAllowSpaceAtBottom(uiDarwinControl *c) +{ + // always allow growth + return YES; } static void windowRelayout(uiWindow *w)