More TODO resolution work.
This commit is contained in:
parent
b130ddc04b
commit
ae0dcada45
|
@ -29,6 +29,16 @@ struct uiSpinbox {
|
||||||
void *onChangedData;
|
void *onChangedData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// yes folks, this varies by operating system! woo!
|
||||||
|
static CGFloat stepperYDelta(void)
|
||||||
|
{
|
||||||
|
// 10.8 - xxx
|
||||||
|
// 10.9 - xxx
|
||||||
|
// 10.10 - xxx
|
||||||
|
// 10.11 - -1
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
@implementation libui_spinbox
|
@implementation libui_spinbox
|
||||||
|
|
||||||
- (id)initWithFrame:(NSRect)r spinbox:(uiSpinbox *)sb
|
- (id)initWithFrame:(NSRect)r spinbox:(uiSpinbox *)sb
|
||||||
|
@ -82,17 +92,17 @@ struct uiSpinbox {
|
||||||
[self addConstraint:mkConstraint(self->stepper, NSLayoutAttributeTop,
|
[self addConstraint:mkConstraint(self->stepper, NSLayoutAttributeTop,
|
||||||
NSLayoutRelationEqual,
|
NSLayoutRelationEqual,
|
||||||
self, NSLayoutAttributeTop,
|
self, NSLayoutAttributeTop,
|
||||||
1, -1, // TODO make sure this is right
|
1, stepperYDelta(),
|
||||||
@"uiSpinbox top edge stepper")];
|
@"uiSpinbox top edge stepper")];
|
||||||
[self addConstraint:mkConstraint(self->stepper, NSLayoutAttributeBottom,
|
[self addConstraint:mkConstraint(self->stepper, NSLayoutAttributeBottom,
|
||||||
NSLayoutRelationEqual,
|
NSLayoutRelationEqual,
|
||||||
self, NSLayoutAttributeBottom,
|
self, NSLayoutAttributeBottom,
|
||||||
1, -1, // TODO make sure this is right
|
1, stepperYDelta(),
|
||||||
@"uiSpinbox bottom edge stepper")];
|
@"uiSpinbox bottom edge stepper")];
|
||||||
[self addConstraint:mkConstraint(self->tf, NSLayoutAttributeTrailing,
|
[self addConstraint:mkConstraint(self->tf, NSLayoutAttributeTrailing,
|
||||||
NSLayoutRelationEqual,
|
NSLayoutRelationEqual,
|
||||||
self->stepper, NSLayoutAttributeLeading,
|
self->stepper, NSLayoutAttributeLeading,
|
||||||
1, -3, // TODO
|
1, -3, // arbitrary amount; good enough visually (and it seems to match NSDatePicker too, at least on 10.11, which is even better)
|
||||||
@"uiSpinbox space between text field and stepper")];
|
@"uiSpinbox space between text field and stepper")];
|
||||||
|
|
||||||
self->spinbox = sb;
|
self->spinbox = sb;
|
||||||
|
|
Loading…
Reference in New Issue