* Source/NSButtonCell.m:

* Source/NSMenuItemCell.m: Make a shared -themeControlState in
NSButtonCell and eliminate duplicated code.
* Source/NSPopUpButtonCell.m: Add private declaration for
-[NSButtonCell themeControlState]


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37236 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ericwa 2013-10-15 18:41:17 +00:00
parent 6ff76480c7
commit cc79a86cb6
4 changed files with 23 additions and 40 deletions

View file

@ -933,7 +933,7 @@ typedef struct _GSButtonCellFlags
ASSIGN(_backgroundColor, color);
}
- (void) drawBezelWithFrame: (NSRect)cellFrame inView: (NSView *)controlView
- (GSThemeControlState) themeControlState
{
unsigned mask;
GSThemeControlState buttonState = GSThemeNormalState;
@ -976,7 +976,8 @@ typedef struct _GSButtonCellFlags
first responder state. Note that GSThemeDisabledState
doesn't have a first responder variant, currently. */
if (_cell.shows_first_responder
&& [[controlView window] firstResponder] == controlView)
&& [[[self controlView] window] firstResponder] == [self controlView]
&& [self controlView] != nil)
{
if (buttonState == GSThemeSelectedState)
buttonState = GSThemeSelectedFirstResponderState;
@ -986,6 +987,13 @@ typedef struct _GSButtonCellFlags
buttonState = GSThemeFirstResponderState;
}
return buttonState;
}
- (void) drawBezelWithFrame: (NSRect)cellFrame inView: (NSView *)controlView
{
GSThemeControlState buttonState = [self themeControlState];
[[GSTheme theme] drawButton: cellFrame
in: self
view: controlView