From cb7205389d88e367aed54afad402e4938feeee9d Mon Sep 17 00:00:00 2001 From: ericwa Date: Mon, 7 Oct 2013 07:29:13 +0000 Subject: [PATCH] * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSThemeDrawing.m: * Source/NSPopUpButtonCell.m: Remove -[GSTheme drawBorderAndBackgroundForPopUpButtonCell: withFrame:inView:state:] which I added recently, and just use -[GSTheme drawButton:in:view:style:state]. This way, NSPopUpButtonCell automatically supports all of the different NSBezelStyles. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37202 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 11 +++++++++++ Headers/Additions/GNUstepGUI/GSTheme.h | 5 ----- Source/GSThemeDrawing.m | 22 ---------------------- Source/NSPopUpButtonCell.m | 15 ++++++++------- 4 files changed, 19 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0caad6e1e..ee79cf8dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2013-10-07 Eric Wasylishen + + * Headers/Additions/GNUstepGUI/GSTheme.h: + * Source/GSThemeDrawing.m: + * Source/NSPopUpButtonCell.m: + Remove -[GSTheme drawBorderAndBackgroundForPopUpButtonCell: + withFrame:inView:state:] which I added recently, and just use + -[GSTheme drawButton:in:view:style:state]. This way, + NSPopUpButtonCell automatically supports all of the different + NSBezelStyles. + 2013-10-07 Eric Wasylishen * Source/GSTitleView.m: Use the GSTheme diff --git a/Headers/Additions/GNUstepGUI/GSTheme.h b/Headers/Additions/GNUstepGUI/GSTheme.h index fabe79b0b..caa4cabf1 100644 --- a/Headers/Additions/GNUstepGUI/GSTheme.h +++ b/Headers/Additions/GNUstepGUI/GSTheme.h @@ -1010,11 +1010,6 @@ APPKIT_EXPORT NSString *GSThemeWillDeactivateNotification; state: (GSThemeControlState)state isHorizontal: (BOOL)isHorizontal; -- (void) drawBorderAndBackgroundForPopUpButtonCell: (NSPopUpButtonCell *)cell - withFrame: (NSRect)cellFrame - inView: (NSView *)controlView - state: (GSThemeControlState)state; - /** *

Draws the menu item title.

* diff --git a/Source/GSThemeDrawing.m b/Source/GSThemeDrawing.m index 2132bb901..10fe990e8 100644 --- a/Source/GSThemeDrawing.m +++ b/Source/GSThemeDrawing.m @@ -1053,28 +1053,6 @@ } } -- (void) drawBorderAndBackgroundForPopUpButtonCell: (NSPopUpButtonCell *)cell - withFrame: (NSRect)cellFrame - inView: (NSView *)controlView - state: (GSThemeControlState)state -{ - GSDrawTiles *tiles = [self tilesNamed: GSPopUpButton state: state]; - if (tiles == nil) - { - [self drawBorderAndBackgroundForMenuItemCell: cell - withFrame: cellFrame - inView: controlView - state: state - isHorizontal: NO]; - } - else - { - [self fillRect: cellFrame - withTiles: tiles - background: [NSColor clearColor]]; - } -} - - (NSColor *) menuSeparatorColor { NSColor *color = [self colorNamed: @"menuSeparatorColor" diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index 4b9546df5..e55720abd 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -1057,17 +1057,18 @@ static NSImage *_pbc_image[5]; } /* - * Override the implementation in NSMenuItemCell to call a different - * GSTheme method, since typically menu items and buttons will be - * drawn differently (though not in the GNUstep default theme). + * Override the implementation in NSMenuItemCell to behave the same + * as superclass NSButtonCell's implementation, since our direct + * superclass NSMenuItemCell has special menu-specific drawing. */ - (void) drawBorderAndBackgroundWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { - [[GSTheme theme] drawBorderAndBackgroundForPopUpButtonCell: self - withFrame: cellFrame - inView: controlView - state: [self themeControlState]]; + [[GSTheme theme] drawButton: cellFrame + in: self + view: controlView + style: _bezel_style + state: [self themeControlState]]; }