mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 06:51:44 +00:00
Better colors
This commit is contained in:
parent
dae6b91c99
commit
da0f7ded36
3 changed files with 22 additions and 8 deletions
|
@ -965,13 +965,15 @@ APPKIT_EXPORT NSString *GSThemeWillDeactivateNotification;
|
|||
forState: (NSControlStateValue)value;
|
||||
|
||||
- (void) drawSwitchBezel: (NSRect)frame
|
||||
withColor: (NSColor*)backgroundColor
|
||||
withOnColor: (NSColor*)onColor
|
||||
withOffColor: (NSColor*)offColor
|
||||
forState: (NSControlStateValue)v;
|
||||
|
||||
- (void) drawSwitchInRect: (NSRect)rect
|
||||
forState: (NSControlStateValue)state
|
||||
enabled: (BOOL)enabled
|
||||
bezelColor: (NSColor *)bColor
|
||||
bezelOnColor: (NSColor *)bOnColor
|
||||
bezelOffColor: (NSColor *)bOffColor
|
||||
knobColor: (NSColor *)kColor;
|
||||
|
||||
// NSSegmentedControl drawing methods
|
||||
|
|
|
@ -819,13 +819,20 @@
|
|||
// NSSwitch drawing methods
|
||||
|
||||
- (void) drawSwitchBezel: (NSRect)frame
|
||||
withColor: (NSColor*)backgroundColor
|
||||
withOnColor: (NSColor*)onColor
|
||||
withOffColor: (NSColor*)offColor
|
||||
forState: (NSControlStateValue)v
|
||||
{
|
||||
NSBezierPath *p;
|
||||
NSPoint point;
|
||||
CGFloat radius;
|
||||
NSColor *backgroundColor = offColor;
|
||||
|
||||
if (NSControlStateValueOn == v)
|
||||
{
|
||||
backgroundColor = onColor;
|
||||
}
|
||||
|
||||
// make smaller than enclosing frame
|
||||
frame = NSInsetRect(frame, 4, 4);
|
||||
radius = frame.size.height / 2.0;
|
||||
|
@ -917,13 +924,17 @@
|
|||
- (void) drawSwitchInRect: (NSRect)rect
|
||||
forState: (NSControlStateValue)state
|
||||
enabled: (BOOL)enabled
|
||||
bezelColor: (NSColor *)bColor
|
||||
bezelOnColor: (NSColor *)bOnColor
|
||||
bezelOffColor: (NSColor *)bOffColor
|
||||
knobColor: (NSColor *)kColor
|
||||
{
|
||||
// Draw the well bezel
|
||||
[self drawSwitchBezel: rect
|
||||
withColor: bColor
|
||||
forState: state];
|
||||
withOnColor: bOnColor
|
||||
withOffColor: bOffColor
|
||||
forState: state];
|
||||
|
||||
// Draw the knob
|
||||
[self drawSwitchKnob: rect
|
||||
withColor: kColor
|
||||
forState: state];
|
||||
|
|
|
@ -73,8 +73,9 @@
|
|||
[[GSTheme theme] drawSwitchInRect: rect
|
||||
forState: _state
|
||||
enabled: [self isEnabled]
|
||||
bezelColor: [NSColor blackColor]
|
||||
knobColor: [NSColor redColor]];
|
||||
bezelOnColor: [NSColor lightGrayColor]
|
||||
bezelOffColor: [NSColor blackColor]
|
||||
knobColor: [NSColor darkGrayColor]];
|
||||
}
|
||||
|
||||
- (void) mouseDown: (NSEvent *)event
|
||||
|
|
Loading…
Reference in a new issue