Fixed build errors and some runtime errors. Things don't look right yet...
This commit is contained in:
parent
f66b5a8873
commit
63dac7c13a
|
@ -46,25 +46,25 @@ void singleChildConstraintsEstablish(struct singleChildConstraints *c, NSView *c
|
|||
[desc stringByAppendingString:@" top constraint"]);
|
||||
[contentView addConstraint:c->topConstraint];
|
||||
|
||||
relation = NSLayoutRelationGreaterOrEqual;
|
||||
relation = NSLayoutRelationGreaterThanOrEqual;
|
||||
if (hugsTrailing)
|
||||
relation = NSLayoutRelationEqual;
|
||||
c->leadingConstraint = mkConstraint(contentView, NSLayoutAttributeTrailing,
|
||||
c->trailingConstraint = mkConstraint(contentView, NSLayoutAttributeTrailing,
|
||||
relation,
|
||||
childView, NSLayoutAttributeTrailing,
|
||||
1, -margin,
|
||||
[desc stringByAppendingString:@" trailing constraint"]);
|
||||
[contentView addConstraint:c->trailingConstraint];
|
||||
|
||||
relation = NSLayoutRelationGreaterOrEqual;
|
||||
relation = NSLayoutRelationGreaterThanOrEqual;
|
||||
if (hugsBottom)
|
||||
relation = NSLayoutRelationEqual;
|
||||
c->leadingConstraint = mkConstraint(contentView, NSLayoutAttributeBottom,
|
||||
c->bottomConstraint = mkConstraint(contentView, NSLayoutAttributeBottom,
|
||||
relation,
|
||||
childView, NSLayoutAttributeBottom,
|
||||
1, -margin,
|
||||
[desc stringByAppendingString:@" bottom constraint"]);
|
||||
[contentView addConstraint:c->leadingConstraint];
|
||||
[contentView addConstraint:c->bottomConstraint];
|
||||
}
|
||||
|
||||
void singleChildConstraintsRemove(struct singleChildConstraints *c, NSView *cv)
|
||||
|
|
11
darwin/box.m
11
darwin/box.m
|
@ -196,15 +196,15 @@ struct uiBox {
|
|||
|
||||
// then arrange in the secondary direction
|
||||
for (bc in self->children) {
|
||||
c = mkConstraint(self, b->secondaryStart,
|
||||
c = mkConstraint(self, self->secondaryStart,
|
||||
NSLayoutRelationEqual,
|
||||
[bc view], b->secondaryStart,
|
||||
[bc view], self->secondaryStart,
|
||||
1, 0,
|
||||
@"uiBox secondary start constraint");
|
||||
[self->otherConstraints addObject:c];
|
||||
c = mkConstraint([bc view], b->secondaryEnd,
|
||||
c = mkConstraint([bc view], self->secondaryEnd,
|
||||
NSLayoutRelationEqual,
|
||||
self, b->secondaryEnd,
|
||||
self, self->secondaryEnd,
|
||||
1, 0,
|
||||
@"uiBox secondary end constraint");
|
||||
[self->otherConstraints addObject:c];
|
||||
|
@ -360,7 +360,7 @@ static void uiBoxSyncEnableState(uiDarwinControl *c, int enabled)
|
|||
|
||||
uiDarwinControlDefaultSetSuperview(uiBox, view)
|
||||
|
||||
static BOOL uiBoxHugsTrailing(uiDarwinControl *c)
|
||||
static BOOL uiBoxHugsTrailingEdge(uiDarwinControl *c)
|
||||
{
|
||||
uiBox *b = uiBox(c);
|
||||
|
||||
|
@ -382,7 +382,6 @@ static void uiBoxChildEdgeHuggingChanged(uiDarwinControl *c)
|
|||
[b->view setNeedsUpdateConstraints:YES];
|
||||
}
|
||||
|
||||
|
||||
void uiBoxAppend(uiBox *b, uiControl *c, int stretchy)
|
||||
{
|
||||
[b->view append:c stretchy:stretchy];
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
struct uiGroup {
|
||||
uiDarwinControl c;
|
||||
libuiIntrinsicBox *box;
|
||||
NSBox *box;
|
||||
uiControl *child;
|
||||
int margined;
|
||||
struct singleChildConstraints constraints;
|
||||
|
@ -102,7 +102,6 @@ void uiGroupSetChild(uiGroup *g, uiControl *child)
|
|||
uiControlSetParent(g->child, NULL);
|
||||
}
|
||||
g->child = child;
|
||||
[g->box libui_setHasChild:(g->child != NULL)];
|
||||
if (g->child != NULL) {
|
||||
childView = (NSView *) uiControlHandle(g->child);
|
||||
uiControlSetParent(g->child, uiControl(g));
|
||||
|
@ -120,7 +119,7 @@ int uiGroupMargined(uiGroup *g)
|
|||
void uiGroupSetMargined(uiGroup *g, int margined)
|
||||
{
|
||||
g->margined = margined;
|
||||
singleChildConstraintsSetMargined(&(w->constraints), w->margined);
|
||||
singleChildConstraintsSetMargined(&(g->constraints), g->margined);
|
||||
// TODO issue a relayout command?
|
||||
}
|
||||
|
||||
|
@ -130,7 +129,7 @@ uiGroup *uiNewGroup(const char *title)
|
|||
|
||||
uiDarwinNewControl(uiGroup, g);
|
||||
|
||||
g->box = [[libuiIntrinsicBox alloc] initWithFrame:NSZeroRect];
|
||||
g->box = [[NSBox alloc] initWithFrame:NSZeroRect];
|
||||
[g->box setTitle:toNSString(title)];
|
||||
[g->box setBoxType:NSBoxPrimary];
|
||||
[g->box setBorderType:NSLineBorder];
|
||||
|
@ -138,7 +137,6 @@ uiGroup *uiNewGroup(const char *title)
|
|||
[g->box setTitlePosition:NSAtTop];
|
||||
// we can't use uiDarwinSetControlFont() because the selector is different
|
||||
[g->box setTitleFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]]];
|
||||
[g->box libui_setHasChild:NO];
|
||||
|
||||
return g;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ struct uiTab {
|
|||
|
||||
@implementation tabPage
|
||||
|
||||
- (id)initWithView:(NSView *)v pageID:(NSObject *o)
|
||||
- (id)initWithView:(NSView *)v pageID:(NSObject *)o
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
|
@ -141,7 +141,7 @@ void uiTabAppend(uiTab *t, const char *name, uiControl *child)
|
|||
|
||||
void uiTabInsertAt(uiTab *t, const char *name, uintmax_t n, uiControl *child)
|
||||
{
|
||||
boxPage *page;
|
||||
tabPage *page;
|
||||
NSView *view;
|
||||
NSTabViewItem *i;
|
||||
NSObject *pageID;
|
||||
|
@ -176,7 +176,6 @@ void uiTabDelete(uiTab *t, uintmax_t n)
|
|||
{
|
||||
tabPage *page;
|
||||
uiControl *child;
|
||||
NSView *childView;
|
||||
NSTabViewItem *i;
|
||||
|
||||
page = (tabPage *) [t->pages objectAtIndex:n];
|
||||
|
|
Loading…
Reference in New Issue