* Headers/Additions/GNUstepGUI/GSTheme.h: Add image parameter,

* Source/GSThemeDrawing.m: Add image parameter.   Correctly
	handle disabled buttons.
	* Source/NSButtonCell.m: Change to use new signature.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28523 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
gcasa 2009-08-23 18:24:34 +00:00
parent e89b630802
commit e70f79fbf7
4 changed files with 21 additions and 12 deletions

View file

@ -1,3 +1,10 @@
2009-08-23 14:23-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Headers/Additions/GNUstepGUI/GSTheme.h: Add image parameter,
* Source/GSThemeDrawing.m: Add image parameter. Correctly
handle disabled buttons.
* Source/NSButtonCell.m: Change to use new signature.
2009-08-23 14:05-EDT Gregory John Casamento <greg.casamento@gmail.com> 2009-08-23 14:05-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Headers/Additions/GNUstepGUI/GSTheme.h: Added new method declaration * Headers/Additions/GNUstepGUI/GSTheme.h: Added new method declaration

View file

@ -565,9 +565,10 @@ APPKIT_EXPORT NSString *GSThemeWillDeactivateNotification;
* of an image a button cell and replace it with a rendered * of an image a button cell and replace it with a rendered
* version (from the native theme). * version (from the native theme).
*/ */
- (void) drawButtonCellImage: (NSButtonCell *) cell - (void) drawImage: (NSImage *)image
withFrame: (NSRect) aRect inButtonCell: (NSButtonCell *) cell
position: (NSPoint) position; withFrame: (NSRect) aRect
position: (NSPoint) position;
@end @end
/** /**

View file

@ -544,21 +544,21 @@
PSstroke(); PSstroke();
} }
- (void) drawButtonCellImage: (NSButtonCell *) cell - (void) drawImage: (NSImage *)image
withFrame: (NSRect) aRect inButtonCell: (NSButtonCell *) cell
position: (NSPoint) position withFrame: (NSRect) aRect
position: (NSPoint) position
{ {
NSImage *anImage = [cell image]; BOOL enabled = [cell isEnabled];
BOOL disabled = [cell isEnabled];
BOOL dims = [cell imageDimsWhenDisabled]; BOOL dims = [cell imageDimsWhenDisabled];
if (disabled && dims) if (!enabled && dims)
{ {
[anImage dissolveToPoint: position fraction: 0.5]; [image dissolveToPoint: position fraction: 0.5];
} }
else else
{ {
[anImage compositeToPoint: position [image compositeToPoint: position
operation: NSCompositeSourceOver]; operation: NSCompositeSourceOver];
} }
} }

View file

@ -916,7 +916,8 @@ typedef struct _GSButtonCellFlags
position.y += size.height; position.y += size.height;
} }
[[GSTheme theme] drawButtonCellImage: self [[GSTheme theme] drawImage: anImage
inButtonCell: self
withFrame: aRect withFrame: aRect
position: position]; position: position];
} }