Did the rest of it as stubs. Now to fix issues...

This commit is contained in:
Pietro Gagliardi 2016-05-08 10:53:52 -04:00
parent 07930279c0
commit 854e87b90a
4 changed files with 11 additions and 43 deletions

View File

@ -95,9 +95,9 @@ struct uiBox {
self->secondaryOrientation = NSLayoutConstraintOrientationVertical; self->secondaryOrientation = NSLayoutConstraintOrientationVertical;
} }
// TODO required? // TODO default high?
self->horzHuggingPri = NSLayoutPriorityDefaultHigh; self->horzHuggingPri = NSLayoutPriorityRequired;
self->vertHuggingPri = NSLayoutPriorityDefaultHigh; self->vertHuggingPri = NSLayoutPriorityRequired;
} }
return self; return self;
} }
@ -132,7 +132,7 @@ struct uiBox {
[self removeConstraints:self->inBetweens]; [self removeConstraints:self->inBetweens];
[self->inBetweens removeAllObjects]; [self->inBetweens removeAllObjects];
[self removeConstraint:self->last]; [self removeConstraint:self->last];
[self removeConstraint:self->last2]; [self removeConstraint:self->lastHugging];
[self removeConstraints:self->otherConstraints]; [self removeConstraints:self->otherConstraints];
[self->otherConstraints removeAllObjects]; [self->otherConstraints removeAllObjects];
} }
@ -300,7 +300,7 @@ struct uiBox {
// TODO will default high work? // TODO will default high work?
uiDarwinControlSetRealHuggingPriority(uiDarwinControl(bc.c), NSLayoutPriorityRequired, self->primaryOrientation); uiDarwinControlSetRealHuggingPriority(uiDarwinControl(bc.c), NSLayoutPriorityRequired, self->primaryOrientation);
// make sure controls don't hug their secondary direction so they fill the width of the view // 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]; [self->children addObject:bc];
[bc release]; // we don't need the initial reference now [bc release]; // we don't need the initial reference now

View File

@ -70,27 +70,9 @@ static void uiGroupSyncEnableState(uiDarwinControl *c, int enabled)
uiDarwinControlDefaultSetSuperview(uiGroup, box) uiDarwinControlDefaultSetSuperview(uiGroup, box)
static BOOL uiGroupChildrenShouldAllowSpaceAtTrailingEdge(uiDarwinControl *c) static void uiGroupSetRealHuggingPriority(uiDarwinControl *c, NSLayoutPriority priority, NSLayoutConstraintOrientation orientation)
{ {
uiControl *parent; // TODO
// 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) static void groupRelayout(uiGroup *g)

View File

@ -56,16 +56,9 @@ uiDarwinControlDefaultSyncEnableState(uiTab, tabview)
uiDarwinControlDefaultSetSuperview(uiTab, tabview) uiDarwinControlDefaultSetSuperview(uiTab, tabview)
static BOOL uiTabChildrenShouldAllowSpaceAtTrailingEdge(uiDarwinControl *c) static void uiTabSetRealHuggingPriority(uiDarwinControl *c, NSLayoutPriority priority, NSLayoutConstraintOrientation orientation)
{ {
// always allow growth // TODO
return YES;
}
static BOOL uiTabChildrenShouldAllowSpaceAtBottom(uiDarwinControl *c)
{
// always allow growth
return YES;
} }
static void tabRelayout(uiTab *t) static void tabRelayout(uiTab *t)

View File

@ -141,16 +141,9 @@ static void uiWindowSetSuperview(uiDarwinControl *c, NSView *superview)
// TODO // TODO
} }
static BOOL uiWindowChildrenShouldAllowSpaceAtTrailingEdge(uiDarwinControl *c) static void uiWindowSetRealHuggingPriority(uiDarwinControl *c, NSLayoutPriority priority, NSLayoutConstraintOrientation orientation)
{ {
// always allow growth // do nothing; uiWindow children never hug (to maintain parity with other OSs)
return YES;
}
static BOOL uiWindowChildrenShouldAllowSpaceAtBottom(uiDarwinControl *c)
{
// always allow growth
return YES;
} }
static void windowRelayout(uiWindow *w) static void windowRelayout(uiWindow *w)