More stretchiness work.
This commit is contained in:
parent
88f137aa80
commit
5bc53f937d
|
@ -71,12 +71,12 @@
|
|||
pp.firstStretchy = TRUE;
|
||||
for (i = 0; i < [self->children count]; i++) {
|
||||
id<tControl> cur;
|
||||
NSNumber *stretchy;
|
||||
NSNumber *isStretchy;
|
||||
|
||||
first[i] = pp.n;
|
||||
cur = (id<tControl>) [self->children objectAtIndex:i];
|
||||
stretchy = (NSNumber *) [self->stretchy objectAtIndex:i];
|
||||
pp.stretchy = [stretchy boolValue];
|
||||
isStretchy = (NSNumber *) [self->stretchy objectAtIndex:i];
|
||||
pp.stretchy = [isStretchy boolValue];
|
||||
[cur tFillAutoLayout:&pp];
|
||||
if (pp.stretchy && pp.firstStretchy) {
|
||||
pp.firstStretchy = FALSE;
|
||||
|
|
|
@ -33,11 +33,27 @@
|
|||
- (void)tFillAutoLayout:(tAutoLayoutParams *)p
|
||||
{
|
||||
NSString *key;
|
||||
NSString *horzpred, *vertpred;
|
||||
|
||||
key = tAutoLayoutKey(p->n);
|
||||
p->n++;
|
||||
[p->horz addObject:[NSString stringWithFormat:@"[%@]", key]];
|
||||
[p->vert addObject:[NSString stringWithFormat:@"[%@]", key]];
|
||||
horzpred = @"";
|
||||
vertpred = @"";
|
||||
if (p->stretchy) {
|
||||
NSString *predicate;
|
||||
|
||||
if (p->firstStretchy)
|
||||
// TODO is this unnecessary? it seems like I need to do other things instead of this to ensure stretchiness...
|
||||
predicate = @"(>=0)";
|
||||
else
|
||||
predicate = [NSString stringWithFormat:@"(==%@)", tAutoLayoutKey(p->stretchyTo)];
|
||||
if (p->stretchyVert)
|
||||
vertpred = predicate;
|
||||
else
|
||||
horzpred = predicate;
|
||||
}
|
||||
[p->horz addObject:[NSString stringWithFormat:@"[%@%@]", key, horzpred]];
|
||||
[p->vert addObject:[NSString stringWithFormat:@"[%@%@]", key, vertpred]];
|
||||
[p->views setObject:self->b forKey:key];
|
||||
}
|
||||
|
||||
|
|
|
@ -76,11 +76,26 @@
|
|||
- (void)tFillAutoLayout:(tAutoLayoutParams *)p
|
||||
{
|
||||
NSString *key;
|
||||
NSString *horzpred, *vertpred;
|
||||
|
||||
key = tAutoLayoutKey(p->n);
|
||||
p->n++;
|
||||
[p->horz addObject:[NSString stringWithFormat:@"[%@]", key]];
|
||||
[p->vert addObject:[NSString stringWithFormat:@"[%@]", key]];
|
||||
horzpred = @"(==96)"; // TODO only the entry
|
||||
vertpred = @"";
|
||||
if (p->stretchy) {
|
||||
NSString *predicate;
|
||||
|
||||
if (p->firstStretchy)
|
||||
predicate = @"(>=0)";
|
||||
else
|
||||
predicate = [NSString stringWithFormat:@"(==%@)", tAutoLayoutKey(p->stretchyTo)];
|
||||
if (p->stretchyVert)
|
||||
vertpred = predicate;
|
||||
else
|
||||
horzpred = predicate;
|
||||
}
|
||||
[p->horz addObject:[NSString stringWithFormat:@"[%@%@]", key, horzpred]];
|
||||
[p->vert addObject:[NSString stringWithFormat:@"[%@%@]", key, vertpred]];
|
||||
[p->views setObject:self->c forKey:key];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue