More stretchiness work.
This commit is contained in:
parent
88f137aa80
commit
5bc53f937d
|
@ -71,12 +71,12 @@
|
||||||
pp.firstStretchy = TRUE;
|
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;
|
NSNumber *isStretchy;
|
||||||
|
|
||||||
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];
|
isStretchy = (NSNumber *) [self->stretchy objectAtIndex:i];
|
||||||
pp.stretchy = [stretchy boolValue];
|
pp.stretchy = [isStretchy boolValue];
|
||||||
[cur tFillAutoLayout:&pp];
|
[cur tFillAutoLayout:&pp];
|
||||||
if (pp.stretchy && pp.firstStretchy) {
|
if (pp.stretchy && pp.firstStretchy) {
|
||||||
pp.firstStretchy = FALSE;
|
pp.firstStretchy = FALSE;
|
||||||
|
|
|
@ -33,11 +33,27 @@
|
||||||
- (void)tFillAutoLayout:(tAutoLayoutParams *)p
|
- (void)tFillAutoLayout:(tAutoLayoutParams *)p
|
||||||
{
|
{
|
||||||
NSString *key;
|
NSString *key;
|
||||||
|
NSString *horzpred, *vertpred;
|
||||||
|
|
||||||
key = tAutoLayoutKey(p->n);
|
key = tAutoLayoutKey(p->n);
|
||||||
p->n++;
|
p->n++;
|
||||||
[p->horz addObject:[NSString stringWithFormat:@"[%@]", key]];
|
horzpred = @"";
|
||||||
[p->vert addObject:[NSString stringWithFormat:@"[%@]", key]];
|
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];
|
[p->views setObject:self->b forKey:key];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,11 +76,26 @@
|
||||||
- (void)tFillAutoLayout:(tAutoLayoutParams *)p
|
- (void)tFillAutoLayout:(tAutoLayoutParams *)p
|
||||||
{
|
{
|
||||||
NSString *key;
|
NSString *key;
|
||||||
|
NSString *horzpred, *vertpred;
|
||||||
|
|
||||||
key = tAutoLayoutKey(p->n);
|
key = tAutoLayoutKey(p->n);
|
||||||
p->n++;
|
p->n++;
|
||||||
[p->horz addObject:[NSString stringWithFormat:@"[%@]", key]];
|
horzpred = @"(==96)"; // TODO only the entry
|
||||||
[p->vert addObject:[NSString stringWithFormat:@"[%@]", key]];
|
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];
|
[p->views setObject:self->c forKey:key];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue