diff --git a/darwin/box.m b/darwin/box.m index 25116c5e..c41ab6f1 100644 --- a/darwin/box.m +++ b/darwin/box.m @@ -95,9 +95,9 @@ struct uiBox { self->secondaryOrientation = NSLayoutConstraintOrientationVertical; } - // TODO required? - self->horzHuggingPri = NSLayoutPriorityDefaultHigh; - self->vertHuggingPri = NSLayoutPriorityDefaultHigh; + // TODO default high? + self->horzHuggingPri = NSLayoutPriorityRequired; + self->vertHuggingPri = NSLayoutPriorityRequired; } return self; } @@ -132,7 +132,7 @@ struct uiBox { [self removeConstraints:self->inBetweens]; [self->inBetweens removeAllObjects]; [self removeConstraint:self->last]; - [self removeConstraint:self->last2]; + [self removeConstraint:self->lastHugging]; [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.cc), NSLayoutPriorityDefaultLow, self->secondaryOrientation); + uiDarwinControlSetRealHuggingPriority(uiDarwinControl(bc.c), 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 663c58cd..1fbce07b 100644 --- a/darwin/group.m +++ b/darwin/group.m @@ -70,27 +70,9 @@ static void uiGroupSyncEnableState(uiDarwinControl *c, int enabled) uiDarwinControlDefaultSetSuperview(uiGroup, box) -static BOOL uiGroupChildrenShouldAllowSpaceAtTrailingEdge(uiDarwinControl *c) +static void uiGroupSetRealHuggingPriority(uiDarwinControl *c, NSLayoutPriority priority, NSLayoutConstraintOrientation orientation) { - 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; + // TODO } static void groupRelayout(uiGroup *g) diff --git a/darwin/tab.m b/darwin/tab.m index 3138b890..8ceb7d4f 100644 --- a/darwin/tab.m +++ b/darwin/tab.m @@ -56,16 +56,9 @@ uiDarwinControlDefaultSyncEnableState(uiTab, tabview) uiDarwinControlDefaultSetSuperview(uiTab, tabview) -static BOOL uiTabChildrenShouldAllowSpaceAtTrailingEdge(uiDarwinControl *c) +static void uiTabSetRealHuggingPriority(uiDarwinControl *c, NSLayoutPriority priority, NSLayoutConstraintOrientation orientation) { - // always allow growth - return YES; -} - -static BOOL uiTabChildrenShouldAllowSpaceAtBottom(uiDarwinControl *c) -{ - // always allow growth - return YES; + // TODO } static void tabRelayout(uiTab *t) diff --git a/darwin/window.m b/darwin/window.m index 4b2248f4..6c879ba4 100644 --- a/darwin/window.m +++ b/darwin/window.m @@ -141,16 +141,9 @@ static void uiWindowSetSuperview(uiDarwinControl *c, NSView *superview) // TODO } -static BOOL uiWindowChildrenShouldAllowSpaceAtTrailingEdge(uiDarwinControl *c) +static void uiWindowSetRealHuggingPriority(uiDarwinControl *c, NSLayoutPriority priority, NSLayoutConstraintOrientation orientation) { - // always allow growth - return YES; -} - -static BOOL uiWindowChildrenShouldAllowSpaceAtBottom(uiDarwinControl *c) -{ - // always allow growth - return YES; + // do nothing; uiWindow children never hug (to maintain parity with other OSs) } static void windowRelayout(uiWindow *w)