Fixed spinbox single-view issues.
This commit is contained in:
parent
2daf46b711
commit
96dfd95fd3
|
@ -25,7 +25,11 @@
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self) {
|
if (self) {
|
||||||
|
NSMutableDictionary *views;
|
||||||
|
NSArray *constraints;
|
||||||
|
|
||||||
self->c = [[tSpinboxContainer alloc] initWithFrame:NSZeroRect];
|
self->c = [[tSpinboxContainer alloc] initWithFrame:NSZeroRect];
|
||||||
|
[self->c setTranslatesAutoresizingMaskIntoConstraints:NO];
|
||||||
|
|
||||||
self->t = [[NSTextField alloc] initWithFrame:NSZeroRect];
|
self->t = [[NSTextField alloc] initWithFrame:NSZeroRect];
|
||||||
[self->t setSelectable:YES];
|
[self->t setSelectable:YES];
|
||||||
|
@ -45,6 +49,19 @@
|
||||||
[self->s setTranslatesAutoresizingMaskIntoConstraints:NO];
|
[self->s setTranslatesAutoresizingMaskIntoConstraints:NO];
|
||||||
[self->c addSubview:self->s];
|
[self->c addSubview:self->s];
|
||||||
|
|
||||||
|
views = [NSMutableDictionary new];
|
||||||
|
[views setObject:self->t forKey:@"t"];
|
||||||
|
[views setObject:self->s forKey:@"s"];
|
||||||
|
|
||||||
|
constraints = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|[t]-[s]|" options:0 metrics:nil views:views];
|
||||||
|
[self->c addConstraints:constraints];
|
||||||
|
constraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[t]|" options:0 metrics:nil views:views];
|
||||||
|
[self->c addConstraints:constraints];
|
||||||
|
constraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[s]|" options:0 metrics:nil views:views];
|
||||||
|
[self->c addConstraints:constraints];
|
||||||
|
|
||||||
|
[views release];
|
||||||
|
|
||||||
self->parent = nil;
|
self->parent = nil;
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
|
|
Loading…
Reference in New Issue