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
|
else
|
||||||
{
|
{
|
||||||
theRect.origin.x = _bounds.size.width - (_cellSize.width * (index + 1));
|
theRect.origin.x = _cellSize.width * index;
|
||||||
theRect.origin.y = _leftBorderOffset;
|
theRect.origin.y = _leftBorderOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -680,24 +680,36 @@ _addLeftBorderOffsetToRect(NSRect aRect, BOOL isHorizontal)
|
||||||
else
|
else
|
||||||
submenuFrame = NSZeroRect;
|
submenuFrame = NSZeroRect;
|
||||||
|
|
||||||
if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil)
|
if (_horizontal == NO)
|
||||||
== GSWindowMakerInterfaceStyle)
|
{
|
||||||
|
if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil)
|
||||||
|
== GSWindowMakerInterfaceStyle)
|
||||||
|
{
|
||||||
|
NSRect aRect = [self rectOfItemAtIndex:
|
||||||
|
[_menu indexOfItemWithSubmenu: aSubmenu]];
|
||||||
|
NSPoint subOrigin = [_window convertBaseToScreen:
|
||||||
|
NSMakePoint(aRect.origin.x,
|
||||||
|
aRect.origin.y)];
|
||||||
|
|
||||||
|
return NSMakePoint (NSMaxX(frame),
|
||||||
|
subOrigin.y - NSHeight(submenuFrame) - 3 +
|
||||||
|
2*[NSMenuView menuBarHeight]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return NSMakePoint(NSMaxX(frame),
|
||||||
|
NSMaxY(frame) - NSHeight(submenuFrame));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
NSRect aRect = [self rectOfItemAtIndex:
|
NSRect aRect = [self rectOfItemAtIndex:
|
||||||
[_menu indexOfItemWithSubmenu: aSubmenu]];
|
[_menu indexOfItemWithSubmenu: aSubmenu]];
|
||||||
NSPoint subOrigin = [_window convertBaseToScreen:
|
NSPoint subOrigin = [_window convertBaseToScreen:
|
||||||
NSMakePoint(aRect.origin.x,
|
NSMakePoint(NSMinX(aRect),
|
||||||
aRect.origin.y)];
|
NSMaxY(aRect))];
|
||||||
|
return NSMakePoint(subOrigin.x,
|
||||||
return NSMakePoint (frame.origin.x + frame.size.width,
|
subOrigin.y - NSHeight(submenuFrame));
|
||||||
subOrigin.y - (submenuFrame.size.height + 3 -
|
|
||||||
2*[NSMenuView menuBarHeight]));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return NSMakePoint (frame.origin.x + frame.size.width,
|
|
||||||
frame.origin.y + frame.size.height
|
|
||||||
- submenuFrame.size.height);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue