mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 23:31:02 +00:00
Merge Source/NSMenu.m - reformat Source/NSLayoutManager.m
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38731 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2a41972a78
commit
03f5d6b879
2 changed files with 27 additions and 20 deletions
|
@ -883,35 +883,37 @@ has the same y origin and height as the line frag rect it is in.
|
|||
glyph_index = [self numberOfGlyphs] - 1;
|
||||
if (glyph_index == (unsigned int)-1)
|
||||
{ /* No information is available. Get default font height. */
|
||||
NSFont *f = [_typingAttributes objectForKey:NSFontAttributeName];
|
||||
NSFont *f = [_typingAttributes objectForKey:NSFontAttributeName];
|
||||
|
||||
/* will be -1 if there are no text containers */
|
||||
*textContainer = num_textcontainers - 1;
|
||||
r = NSMakeRect(0, 0, 1, [f boundingRectForFont].size.height);
|
||||
if (num_textcontainers > 0)
|
||||
{
|
||||
{
|
||||
NSParagraphStyle *paragraph = [_typingAttributes objectForKey: NSParagraphStyleAttributeName];
|
||||
NSTextAlignment alignment = [paragraph alignment];
|
||||
|
||||
tc = textcontainers + num_textcontainers - 1;
|
||||
r.origin.x += [tc->textContainer lineFragmentPadding];
|
||||
|
||||
// Apply left/right/center justification...
|
||||
if (alignment == NSRightTextAlignment)
|
||||
{
|
||||
NSTextAlignment alignment = [paragraph alignment];
|
||||
|
||||
tc = textcontainers + num_textcontainers - 1;
|
||||
r.origin.x += [tc->textContainer lineFragmentPadding];
|
||||
|
||||
// Apply left/right/center justification...
|
||||
if (alignment == NSRightTextAlignment)
|
||||
{
|
||||
r.origin.x += [tc->textContainer containerSize].width;
|
||||
}
|
||||
else if (alignment == NSCenterTextAlignment)
|
||||
{
|
||||
}
|
||||
else if (alignment == NSCenterTextAlignment)
|
||||
{
|
||||
r.origin.x += [tc->textContainer containerSize].width / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
fraction_through = 1.0;
|
||||
}
|
||||
else
|
||||
[self _doLayoutToGlyph: glyph_index];
|
||||
{
|
||||
[self _doLayoutToGlyph: glyph_index];
|
||||
}
|
||||
|
||||
for (tc = textcontainers, i = 0; i < num_textcontainers; i++, tc++)
|
||||
if (tc->pos + tc->length > glyph_index)
|
||||
|
|
|
@ -503,7 +503,8 @@ static BOOL menuBarVisible = YES;
|
|||
|
||||
if ((_aWindow != nil) && ([_aWindow screen] != nil))
|
||||
{
|
||||
origin = NSMakePoint(0, [[_aWindow screen] visibleFrame].size.height - [_aWindow frame].size.height);
|
||||
origin = NSMakePoint(0, [[_aWindow screen] visibleFrame].size.height
|
||||
- [_aWindow frame].size.height);
|
||||
|
||||
[_aWindow setFrameOrigin: origin];
|
||||
[_bWindow setFrameOrigin: origin];
|
||||
|
@ -831,6 +832,7 @@ static BOOL menuBarVisible = YES;
|
|||
[self menuChanged];
|
||||
}
|
||||
|
||||
// Testplant-MAL-2015-07-01: Using testplant branch code...
|
||||
- (void) removeAllItems
|
||||
{
|
||||
[_items makeObjectsPerformSelector:@selector(setMenu:) withObject:nil];
|
||||
|
@ -902,7 +904,7 @@ static BOOL menuBarVisible = YES;
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (id <NSMenuItem>) itemAtIndex: (NSInteger)index
|
||||
- (NSMenuItem *) itemAtIndex: (NSInteger)index
|
||||
{
|
||||
if (index >= [_items count] || index < 0)
|
||||
[NSException raise: NSRangeException
|
||||
|
@ -1093,6 +1095,7 @@ static BOOL menuBarVisible = YES;
|
|||
|
||||
- (void) update
|
||||
{
|
||||
// Testplant-MAL-2015-07-01: Stop potential recursive invocation...
|
||||
if (_menu.isUpdating == NO)
|
||||
{
|
||||
_menu.isUpdating = YES;
|
||||
|
@ -1243,6 +1246,7 @@ static BOOL menuBarVisible = YES;
|
|||
}
|
||||
}
|
||||
|
||||
// Testplant-MAL-2015-07-01: Stop potential recursive invocation...
|
||||
_menu.isUpdating = NO;
|
||||
}
|
||||
|
||||
|
@ -1508,6 +1512,7 @@ static BOOL menuBarVisible = YES;
|
|||
return _menu.changedMessagesEnabled;
|
||||
}
|
||||
|
||||
// Testplant-MAL-2015-07-01: Using testplant branch code...
|
||||
- (NSSize) size
|
||||
{
|
||||
if (_view)
|
||||
|
@ -1585,10 +1590,10 @@ static BOOL menuBarVisible = YES;
|
|||
forView: (NSView *)view
|
||||
withFont: (NSFont *)font
|
||||
{
|
||||
// Testplant-MAL-2015-07-01: Using tetplant branch code...
|
||||
NSPoint point = [view frame].origin;
|
||||
point = [[view superview] convertPoint:point toView:nil];
|
||||
point = [[view window] convertBaseToScreen: point];
|
||||
// [[menu window] setFrameOrigin:point];
|
||||
point = [[view window] convertBaseToScreen: point];
|
||||
[menu _rightMouseDisplay: event];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue