aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nsmenu.m18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/nsmenu.m b/src/nsmenu.m
index d5321dcdc6d..ac36150915a 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -539,6 +539,12 @@ skipspc (const char *s)
539{ 539{
540 widget_value *first_wv = (widget_value *)wvptr; 540 widget_value *first_wv = (widget_value *)wvptr;
541 NSFont *menuFont = [NSFont menuFontOfSize:0]; 541 NSFont *menuFont = [NSFont menuFontOfSize:0];
542 NSDictionary *attributes = nil;
543
544#ifdef NS_IMPL_COCOA
545 /* Cocoa doesn't allow multi-key chording in its menu display, so
546 work around it by using tabs to split the title into two
547 columns. */
542 NSDictionary *font_attribs = @{NSFontAttributeName: menuFont}; 548 NSDictionary *font_attribs = @{NSFontAttributeName: menuFont};
543 CGFloat maxNameWidth = 0; 549 CGFloat maxNameWidth = 0;
544 CGFloat maxKeyWidth = 0; 550 CGFloat maxKeyWidth = 0;
@@ -564,12 +570,14 @@ skipspc (const char *s)
564 /* Set a right-aligned tab stop at the maximum width, so that the 570 /* Set a right-aligned tab stop at the maximum width, so that the
565 key will appear immediately to the left of it. */ 571 key will appear immediately to the left of it. */
566 NSTextTab *tab = 572 NSTextTab *tab =
567 [[NSTextTab alloc] initWithTextAlignment: NSTextAlignmentRight 573 [[[NSTextTab alloc] initWithTextAlignment: NSTextAlignmentRight
568 location: maxWidth 574 location: maxWidth
569 options: @{}]; 575 options: @{}] autorelease];
570 NSMutableParagraphStyle *pstyle = [[NSMutableParagraphStyle alloc] init]; 576 NSMutableParagraphStyle *pstyle = [[[NSMutableParagraphStyle alloc] init]
577 autorelease];
571 [pstyle setTabStops: @[tab]]; 578 [pstyle setTabStops: @[tab]];
572 NSDictionary *attributes = @{NSParagraphStyleAttributeName: pstyle}; 579 attributes = @{NSParagraphStyleAttributeName: pstyle};
580#endif
573 581
574 /* clear existing contents */ 582 /* clear existing contents */
575 [self removeAllItems]; 583 [self removeAllItems];