* Headers/Additions/GNUstepGUI/GSTheme.h: Added new method declaration

for drawButtonCell:...
	* Source/GSThemeDrawing.m: Added implementation for new method.  The
	purpose of the method is to allow the theme to override images with
	native images which may be theme dependent.
	* Source/NSButtonCell.m: Use the new method.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28522 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2009-08-23 18:07:39 +00:00
parent 8949deeb03
commit bc95107253
4 changed files with 41 additions and 10 deletions

View file

@ -1,3 +1,12 @@
2009-08-23 14:05-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Headers/Additions/GNUstepGUI/GSTheme.h: Added new method declaration
for drawButtonCell:...
* Source/GSThemeDrawing.m: Added implementation for new method. The
purpose of the method is to allow the theme to override images with
native images which may be theme dependent.
* Source/NSButtonCell.m: Use the new method.
2009-08-23 Doug Simons <dpsimons@testplant.com>
* Source/GSHorizontalTypesetter.m: Remove unlock and

View file

@ -558,6 +558,16 @@ APPKIT_EXPORT NSString *GSThemeWillDeactivateNotification;
* Draw highlighted stepper down button
*/
- (void) drawStepperHighlightDownButton: (NSRect) aRect;
// Draw a button cell.
/**
* In some themes it may be necessary to override the drawing
* of an image a button cell and replace it with a rendered
* version (from the native theme).
*/
- (void) drawButtonCellImage: (NSButtonCell *) cell
withFrame: (NSRect) aRect
position: (NSPoint) position;
@end
/**

View file

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

View file

@ -915,16 +915,10 @@ typedef struct _GSButtonCellFlags
{
position.y += size.height;
}
if (_cell.is_disabled && _image_dims_when_disabled)
{
[anImage dissolveToPoint: position fraction: 0.5];
}
else
{
[anImage compositeToPoint: position
operation: NSCompositeSourceOver];
}
[[GSTheme theme] drawButtonCellImage: self
withFrame: aRect
position: position];
}
}