Laid the foundation for handling stretchiness.

This commit is contained in:
Pietro Gagliardi 2015-08-02 12:35:48 -04:00
parent fbbe1fdd3b
commit 88f137aa80
2 changed files with 13 additions and 0 deletions

View File

@ -67,12 +67,21 @@
pp.extraVert = p->extraVert;
pp.views = p->views;
pp.n = p->n;
pp.stretchyVert = self->vertical;
pp.firstStretchy = TRUE;
for (i = 0; i < [self->children count]; i++) {
id<tControl> cur;
NSNumber *stretchy;
first[i] = pp.n;
cur = (id<tControl>) [self->children objectAtIndex:i];
stretchy = (NSNumber *) [self->stretchy objectAtIndex:i];
pp.stretchy = [stretchy boolValue];
[cur tFillAutoLayout:&pp];
if (pp.stretchy && pp.firstStretchy) {
pp.firstStretchy = FALSE;
pp.stretchyTo = first[i];
}
}
p->n = pp.n;

View File

@ -11,6 +11,10 @@ struct tAutoLayoutParams {
NSMutableArray *extraVert;
NSMutableDictionary *views;
uintmax_t n;
BOOL stretchy;
BOOL stretchyVert;
BOOL firstStretchy;
uintmax_t stretchyTo;
};
@protocol tControl