Laid the foundation for handling stretchiness.
This commit is contained in:
parent
fbbe1fdd3b
commit
88f137aa80
|
@ -67,12 +67,21 @@
|
||||||
pp.extraVert = p->extraVert;
|
pp.extraVert = p->extraVert;
|
||||||
pp.views = p->views;
|
pp.views = p->views;
|
||||||
pp.n = p->n;
|
pp.n = p->n;
|
||||||
|
pp.stretchyVert = self->vertical;
|
||||||
|
pp.firstStretchy = TRUE;
|
||||||
for (i = 0; i < [self->children count]; i++) {
|
for (i = 0; i < [self->children count]; i++) {
|
||||||
id<tControl> cur;
|
id<tControl> cur;
|
||||||
|
NSNumber *stretchy;
|
||||||
|
|
||||||
first[i] = pp.n;
|
first[i] = pp.n;
|
||||||
cur = (id<tControl>) [self->children objectAtIndex:i];
|
cur = (id<tControl>) [self->children objectAtIndex:i];
|
||||||
|
stretchy = (NSNumber *) [self->stretchy objectAtIndex:i];
|
||||||
|
pp.stretchy = [stretchy boolValue];
|
||||||
[cur tFillAutoLayout:&pp];
|
[cur tFillAutoLayout:&pp];
|
||||||
|
if (pp.stretchy && pp.firstStretchy) {
|
||||||
|
pp.firstStretchy = FALSE;
|
||||||
|
pp.stretchyTo = first[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
p->n = pp.n;
|
p->n = pp.n;
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,10 @@ struct tAutoLayoutParams {
|
||||||
NSMutableArray *extraVert;
|
NSMutableArray *extraVert;
|
||||||
NSMutableDictionary *views;
|
NSMutableDictionary *views;
|
||||||
uintmax_t n;
|
uintmax_t n;
|
||||||
|
BOOL stretchy;
|
||||||
|
BOOL stretchyVert;
|
||||||
|
BOOL firstStretchy;
|
||||||
|
uintmax_t stretchyTo;
|
||||||
};
|
};
|
||||||
|
|
||||||
@protocol tControl
|
@protocol tControl
|
||||||
|
|
Loading…
Reference in New Issue