* Headers/AppKit/NSImageCell.h:

* Headers/AppKit/NSCell.h: Move NSImageScaling constants to NSCell
* Source/NSImageCell.m:
* Source/NSCell.m: Refactor the image scaling logic to a private
method in NSCell, -_scaleImageWithSize:toFitInSize:scalingType:
which can be share by NSImageCell, NSButtonCell, and any other
cell classes that need it.
* Source/NSButtonCell.m:
* Headers/AppKit/NSButtonCell.h: Implement -imageScaling and
-setImageScaling methods. 
* Source/GSThemeDrawing.m:
* Headers/Additions/GNUstepGUI/GSTheme.h: Remove the
-drawImage:inButtonCell:withFrame:position: API intended
to let themes substitute images right before drawing,
as IMHO it's the wrong place to hook in new images (by
the time this method was caleld, sizing/positionging
was already done).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34160 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2011-11-11 23:10:15 +00:00
parent 45d5c38825
commit 60674d5076
9 changed files with 202 additions and 119 deletions

View file

@ -136,6 +136,7 @@ typedef enum _NSGradientType {
#define _image_dims_when_disabled _cell.subclass_bool_two
#define _shows_border_only_while_mouse_inside _cell.subclass_bool_three
#define _mouse_inside _cell.subclass_bool_four
NSImageScaling _imageScaling;
}
//
@ -165,6 +166,10 @@ typedef enum _NSGradientType {
- (NSCellImagePosition)imagePosition;
- (void)setAlternateImage: (NSImage *)anImage;
- (void)setImagePosition: (NSCellImagePosition)aPosition;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
- (NSImageScaling)imageScaling;
- (void)setImageScaling:(NSImageScaling)scaling;
#endif
//
// Setting the Repeat Interval