mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-20 18:26:23 +00:00
* Source/NSMenuItemCell.m (-titleRectForBounds:): Keep title rect
inside cell bounds, to prevent drawing text outside of a NSPopUpButtonCell which has a label that is too long to fit. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34838 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3d73efb55c
commit
ac0663e17a
2 changed files with 12 additions and 3 deletions
|
@ -565,7 +565,8 @@ static NSString *commandKeyString = @"#";
|
|||
{
|
||||
// Calculate the image part of cell frame from NSMenuView
|
||||
cellFrame.origin.x += [_menuView imageAndTitleOffset];
|
||||
cellFrame.size.width = [_menuView imageAndTitleWidth];
|
||||
cellFrame.size.width = MIN(cellFrame.size.width - [_menuView imageAndTitleOffset],
|
||||
[_menuView imageAndTitleWidth]);
|
||||
|
||||
switch (_cell.image_position)
|
||||
{
|
||||
|
@ -579,11 +580,13 @@ static NSString *commandKeyString = @"#";
|
|||
|
||||
case NSImageLeft:
|
||||
cellFrame.origin.x += _imageWidth + GSCellTextImageXDist;
|
||||
cellFrame.size.width = _titleWidth;
|
||||
cellFrame.size.width = MIN(cellFrame.size.width - (_imageWidth + GSCellTextImageXDist),
|
||||
_titleWidth);
|
||||
break;
|
||||
|
||||
case NSImageRight:
|
||||
cellFrame.size.width = _titleWidth;
|
||||
cellFrame.size.width = MIN(cellFrame.size.width - (_imageWidth + GSCellTextImageXDist),
|
||||
_titleWidth);
|
||||
break;
|
||||
|
||||
case NSImageBelow:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue