* Source/NSMenuItemCell.m (-titleRectForBounds:): Attempted fix

for bug 35702.
Don't use [_menuView imageAndTitleWidth] or
_titleWidth in calculating the size to put the title in. In other
words, -titleRectForBounds: will now return the available space
for the title, rather than the rect that the title text is
predicted to use up.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34885 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2012-03-06 04:24:51 +00:00
parent 4193fb4122
commit 733983d52b
2 changed files with 13 additions and 6 deletions

View file

@ -1,3 +1,13 @@
2012-03-05 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSMenuItemCell.m (-titleRectForBounds:): Attempted fix
for bug 35702.
Don't use [_menuView imageAndTitleWidth] or
_titleWidth in calculating the size to put the title in. In other
words, -titleRectForBounds: will now return the available space
for the title, rather than the rect that the title text is
predicted to use up.
2012-02-29 10:31-EST Gregory John Casamento <greg.casamento@gmail.com>
* Headers/AppKit/NSTreeController.h

View file

@ -565,8 +565,7 @@ static NSString *commandKeyString = @"#";
{
// Calculate the image part of cell frame from NSMenuView
cellFrame.origin.x += [_menuView imageAndTitleOffset];
cellFrame.size.width = MIN(cellFrame.size.width - [_menuView imageAndTitleOffset],
[_menuView imageAndTitleWidth]);
cellFrame.size.width = cellFrame.size.width - [_menuView imageAndTitleOffset];
switch (_cell.image_position)
{
@ -580,13 +579,11 @@ static NSString *commandKeyString = @"#";
case NSImageLeft:
cellFrame.origin.x += _imageWidth + GSCellTextImageXDist;
cellFrame.size.width = MIN(cellFrame.size.width - (_imageWidth + GSCellTextImageXDist),
_titleWidth);
cellFrame.size.width = cellFrame.size.width - (_imageWidth + GSCellTextImageXDist);
break;
case NSImageRight:
cellFrame.size.width = MIN(cellFrame.size.width - (_imageWidth + GSCellTextImageXDist),
_titleWidth);
cellFrame.size.width = cellFrame.size.width - (_imageWidth + GSCellTextImageXDist);
break;
case NSImageBelow: