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;
}
// 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

View File

@ -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)

View File

@ -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)

View File

@ -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)