mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-21 02:30:59 +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
|
@ -1,3 +1,9 @@
|
||||||
|
2012-02-27 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2012-02-27 Fred Kiefer <FredKiefer@gmx.de>
|
2012-02-27 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/NSWindowController.m (-initWithWindow:): Set the owner to
|
* Source/NSWindowController.m (-initWithWindow:): Set the owner to
|
||||||
|
|
|
@ -565,7 +565,8 @@ static NSString *commandKeyString = @"#";
|
||||||
{
|
{
|
||||||
// Calculate the image part of cell frame from NSMenuView
|
// Calculate the image part of cell frame from NSMenuView
|
||||||
cellFrame.origin.x += [_menuView imageAndTitleOffset];
|
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)
|
switch (_cell.image_position)
|
||||||
{
|
{
|
||||||
|
@ -579,11 +580,13 @@ static NSString *commandKeyString = @"#";
|
||||||
|
|
||||||
case NSImageLeft:
|
case NSImageLeft:
|
||||||
cellFrame.origin.x += _imageWidth + GSCellTextImageXDist;
|
cellFrame.origin.x += _imageWidth + GSCellTextImageXDist;
|
||||||
cellFrame.size.width = _titleWidth;
|
cellFrame.size.width = MIN(cellFrame.size.width - (_imageWidth + GSCellTextImageXDist),
|
||||||
|
_titleWidth);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NSImageRight:
|
case NSImageRight:
|
||||||
cellFrame.size.width = _titleWidth;
|
cellFrame.size.width = MIN(cellFrame.size.width - (_imageWidth + GSCellTextImageXDist),
|
||||||
|
_titleWidth);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NSImageBelow:
|
case NSImageBelow:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue