mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 11:00:48 +00:00
* Source/GSFontInfo.m (-defaultLineHeightForFont): Adjust line
height calculation. * Source/NSButtonCell.m (-drawInteriorWithFrame:inView:): Always initialize imageRect and titleRect. Adjust the calculations to match the new line height. (-cellSize): Always initialize imageRect and titleRect. * Headers/AppKit/NSCell.h (-_drawImage:inFrame:isFlipped:): Remove. * Source/NSCell.m (-_drawImage:inFrame:isFlipped:): Remove. Move code back ... (-drawInteriorWithFrame:inView:): ... here. * Source/NSToolbarItem.m (+initialize): Remove. (+cellClass): Add. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20100 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e2e0084fdb
commit
811ae4cf9f
6 changed files with 69 additions and 50 deletions
|
@ -889,7 +889,7 @@ static NSColor *shadowCol;
|
|||
return textObject;
|
||||
}
|
||||
|
||||
- (NSString*) title
|
||||
- (NSString*) title
|
||||
{
|
||||
return [self stringValue];
|
||||
}
|
||||
|
@ -1670,21 +1670,34 @@ static NSColor *shadowCol;
|
|||
switch (_cell.type)
|
||||
{
|
||||
case NSTextCellType:
|
||||
[self _drawAttributedText: [self attributedStringValue]
|
||||
inFrame: cellFrame];
|
||||
{
|
||||
[self _drawAttributedText: [self attributedStringValue]
|
||||
inFrame: cellFrame];
|
||||
}
|
||||
break;
|
||||
|
||||
case NSImageCellType:
|
||||
if (_cell_image)
|
||||
{
|
||||
[self _drawImage: _cell_image
|
||||
inFrame: cellFrame
|
||||
isFlipped: [controlView isFlipped]];
|
||||
}
|
||||
break;
|
||||
NSSize size;
|
||||
NSPoint position;
|
||||
|
||||
size = [_cell_image size];
|
||||
position.x = MAX(NSMidX(cellFrame) - (size.width/2.),0.);
|
||||
position.y = MAX(NSMidY(cellFrame) - (size.height/2.),0.);
|
||||
/*
|
||||
* Images are always drawn with their bottom-left corner
|
||||
* at the origin so we must adjust the position to take
|
||||
* account of a flipped view.
|
||||
*/
|
||||
if ([controlView isFlipped])
|
||||
position.y += size.height;
|
||||
[_cell_image compositeToPoint: position operation: NSCompositeSourceOver];
|
||||
}
|
||||
break;
|
||||
|
||||
case NSNullCellType:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
if (_cell.shows_first_responder)
|
||||
|
@ -2199,27 +2212,6 @@ static NSColor *shadowCol;
|
|||
RELEASE (attributes);
|
||||
}
|
||||
|
||||
- (void) _drawImage: (NSImage *)anImage inFrame: (NSRect)aRect
|
||||
isFlipped: (BOOL)flipped
|
||||
{
|
||||
NSSize size;
|
||||
NSPoint position;
|
||||
|
||||
size = [anImage size];
|
||||
position.x = MAX(NSMidX(aRect) - (size.width/2.),0.);
|
||||
position.y = MAX(NSMidY(aRect) - (size.height/2.),0.);
|
||||
|
||||
/*
|
||||
* Images are always drawn with their bottom-left corner
|
||||
* at the origin so we must adjust the position to take
|
||||
* account of a flipped view.
|
||||
*/
|
||||
if (flipped)
|
||||
position.y += size.height;
|
||||
|
||||
[anImage compositeToPoint: position operation: NSCompositeSourceOver];
|
||||
}
|
||||
|
||||
- (BOOL) _sendsActionOn:(int)eventTypeMask
|
||||
{
|
||||
return (_action_mask & eventTypeMask);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue