mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 09:21:22 +00:00
* 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:
parent
6ff76480c7
commit
cc79a86cb6
4 changed files with 23 additions and 40 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue