Fix NSButtonCell size calculations. Rename xDist and yDist.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@19814 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
alexm 2004-08-02 14:36:09 +00:00
parent 6454346206
commit cb93530d65
5 changed files with 123 additions and 121 deletions

View file

@ -276,7 +276,7 @@ static NSImage *arrowImage = nil; /* Cache arrow image. */
break;
case NSImageRight:
cellFrame.origin.x += _titleWidth + xDist;
cellFrame.origin.x += _titleWidth + GSCellTextImageXDist;
cellFrame.size.width = _imageWidth;
break;
@ -313,40 +313,40 @@ static NSImage *arrowImage = nil; /* Cache arrow image. */
- (NSRect) titleRectForBounds:(NSRect)cellFrame
{
// Calculate the image part of cell frame from NSMenuView
cellFrame.origin.x += [_menuView imageAndTitleOffset];
cellFrame.size.width = [_menuView imageAndTitleWidth];
// Calculate the image part of cell frame from NSMenuView
cellFrame.origin.x += [_menuView imageAndTitleOffset];
cellFrame.size.width = [_menuView imageAndTitleWidth];
switch (_cell.image_position)
{
case NSNoImage:
case NSImageOverlaps:
break;
switch (_cell.image_position)
{
case NSNoImage:
case NSImageOverlaps:
break;
case NSImageOnly:
cellFrame = NSZeroRect;
break;
case NSImageOnly:
cellFrame = NSZeroRect;
break;
case NSImageLeft:
cellFrame.origin.x += _imageWidth + xDist;
cellFrame.size.width = _titleWidth;
break;
case NSImageLeft:
cellFrame.origin.x += _imageWidth + GSCellTextImageXDist;
cellFrame.size.width = _titleWidth;
break;
case NSImageRight:
cellFrame.size.width = _titleWidth;
break;
case NSImageRight:
cellFrame.size.width = _titleWidth;
break;
case NSImageBelow:
cellFrame.size.height /= 2;
cellFrame.origin.y += cellFrame.size.height;
break;
case NSImageBelow:
cellFrame.size.height /= 2;
cellFrame.origin.y += cellFrame.size.height;
break;
case NSImageAbove:
cellFrame.size.height /= 2;
break;
}
case NSImageAbove:
cellFrame.size.height /= 2;
break;
}
return cellFrame;
return cellFrame;
}
//