mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 06:41:12 +00:00
[rectOfItemAtIndex:] for horizontal orientation set items from
left to right. [locationForSubmenu:] for horizontal orientation set submenu below the item in self. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13662 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f7edb957d6
commit
5522e94e87
1 changed files with 28 additions and 16 deletions
|
@ -609,7 +609,7 @@ _addLeftBorderOffsetToRect(NSRect aRect, BOOL isHorizontal)
|
|||
}
|
||||
else
|
||||
{
|
||||
theRect.origin.x = _bounds.size.width - (_cellSize.width * (index + 1));
|
||||
theRect.origin.x = _cellSize.width * index;
|
||||
theRect.origin.y = _leftBorderOffset;
|
||||
}
|
||||
|
||||
|
@ -680,6 +680,8 @@ _addLeftBorderOffsetToRect(NSRect aRect, BOOL isHorizontal)
|
|||
else
|
||||
submenuFrame = NSZeroRect;
|
||||
|
||||
if (_horizontal == NO)
|
||||
{
|
||||
if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil)
|
||||
== GSWindowMakerInterfaceStyle)
|
||||
{
|
||||
|
@ -689,15 +691,25 @@ _addLeftBorderOffsetToRect(NSRect aRect, BOOL isHorizontal)
|
|||
NSMakePoint(aRect.origin.x,
|
||||
aRect.origin.y)];
|
||||
|
||||
return NSMakePoint (frame.origin.x + frame.size.width,
|
||||
subOrigin.y - (submenuFrame.size.height + 3 -
|
||||
2*[NSMenuView menuBarHeight]));
|
||||
return NSMakePoint (NSMaxX(frame),
|
||||
subOrigin.y - NSHeight(submenuFrame) - 3 +
|
||||
2*[NSMenuView menuBarHeight]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return NSMakePoint (frame.origin.x + frame.size.width,
|
||||
frame.origin.y + frame.size.height
|
||||
- submenuFrame.size.height);
|
||||
return NSMakePoint(NSMaxX(frame),
|
||||
NSMaxY(frame) - NSHeight(submenuFrame));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSRect aRect = [self rectOfItemAtIndex:
|
||||
[_menu indexOfItemWithSubmenu: aSubmenu]];
|
||||
NSPoint subOrigin = [_window convertBaseToScreen:
|
||||
NSMakePoint(NSMinX(aRect),
|
||||
NSMaxY(aRect))];
|
||||
return NSMakePoint(subOrigin.x,
|
||||
subOrigin.y - NSHeight(submenuFrame));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue