* Images/common_StepperDown.tiff,

* Images/common_StepperDownHighlighted.tiff,
* Images/common_StepperUp.tiff,
* Images/common_StepperUpHighlighted.tiff: new images with arrows
similar to scroll view buttons'.

* Source/GSThemeDrawing.m (stepperUpButtonRectWithFrame:),
(stepperDownButtonRectWithFrame:): center buttons horizontally; simplify
and cleanup.

* Source/NSStepper.m (acceptsFirstResponder): return NO. Returning
YES makes sense only if `keyDown:` is implemented.
(acceptsFirstMouse:): return YES.

* Source/NSStepperCell.m (cellSize): initial implementation. Retruns
minimum size based on up and button sizes.
This commit is contained in:
Sergii Stoian 2020-01-10 15:46:22 +02:00
parent 3f6da64b52
commit 9a58a93ee5
8 changed files with 54 additions and 8 deletions

View file

@ -346,6 +346,24 @@
return mouseWentUp;
}
- (NSSize) cellSize
{
NSRect upRect = [[GSTheme theme]
stepperUpButtonRectWithFrame: [_control_view bounds]];
NSRect downRect = [[GSTheme theme]
stepperDownButtonRectWithFrame: [_control_view bounds]];
NSSize size;
if (upRect.size.width > downRect.size.width)
size.width = upRect.size.width;
else
size.width = downRect.size.width;
size.height = upRect.size.height + downRect.size.height;
return size;
}
//
// NSCoding protocol
//