* Headers/Additions/GNUstepGUI/GSTheme.h: New GSThemeMargins struct.

Rename buttonBorderForCell:style:state: to buttonMarginsForCell:style:state:
and return the top/bottom/left/right margins instead of just two values.
(This is a theme API break.)
* Source/GSThemeDrawing.m: Implement buttonMarginsForCell:style:state:.
Also reduce the top and left margin of the default button by 1 pt, to
better reflect the button's appearance.
* Source/GSGuiPrivate.h: Add a GSRoundTowardsNegativeInfinity function
* Source/NSButtonCell.m (-drawImage:withFrame:inView:): Round the image
position down and to the right, as this seems to look the best.
* Source/NSButtonCell.m (-cellSize): Call new buttonMarginsForCell: method
* Source/NSButtonCell.m (-drawingRectForBounds:): Call new
buttonMarginsForCell: method


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33743 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2011-08-15 23:12:37 +00:00
parent 6ec3f1a58b
commit 01c4a0be63
5 changed files with 137 additions and 57 deletions

View file

@ -287,7 +287,17 @@ APPKIT_EXPORT NSString *GSProgressIndicatorBarDeterminate;
*/
APPKIT_EXPORT NSString *GSColorWell;
/**
* Structure to describe the size of top/bottom/left/right margins inside
* a button
*/
typedef struct GSThemeMargins
{
CGFloat left;
CGFloat right;
CGFloat top;
CGFloat bottom;
} GSThemeMargins;
/**
* This defines how the values in a tile array should be used when
@ -732,9 +742,9 @@ APPKIT_EXPORT NSString *GSThemeWillDeactivateNotification;
/**
* Amount by which the button is inset by the border.
*/
- (NSSize) buttonBorderForCell: (NSCell*)cell
style: (int)style
state: (GSThemeControlState)state;
- (GSThemeMargins) buttonMarginsForCell: (NSCell*)cell
style: (int)style
state: (GSThemeControlState)state;
/**
* Draws the indicator (normally a dotted rectangle) to show that