Pass menuForEvent: to the enclosing tableview. This gets contextual menus to appear in e timeline.

This commit is contained in:
Brent Simmons 2018-02-09 21:40:09 -08:00
parent 839780303f
commit dcf758acc5
2 changed files with 19 additions and 0 deletions

View File

@ -6,6 +6,7 @@
// Copyright © 2016 Ranchero Software, LLC. All rights reserved. // Copyright © 2016 Ranchero Software, LLC. All rights reserved.
// //
@import RSCore;
#import "RSMultiLineView.h" #import "RSMultiLineView.h"
#import "RSMultiLineRenderer.h" #import "RSMultiLineRenderer.h"
#import "RSMultiLineRendererMeasurements.h" #import "RSMultiLineRendererMeasurements.h"
@ -137,6 +138,16 @@ static NSAttributedString *emptyAttributedString = nil;
} }
- (NSMenu *)menuForEvent:(NSEvent *)event {
NSTableView *tableView = [self rs_enclosingTableView];
if (tableView) {
return [tableView menuForEvent:event];
}
return nil;
}
- (void)drawRect:(NSRect)r { - (void)drawRect:(NSRect)r {
if (self.selected) { if (self.selected) {

View File

@ -124,6 +124,14 @@ static NSAttributedString *emptyAttributedString = nil;
return self.intrinsicSize; return self.intrinsicSize;
} }
- (NSMenu *)menuForEvent:(NSEvent *)event {
NSTableView *tableView = [self rs_enclosingTableView];
if (tableView) {
return [tableView menuForEvent:event];
}
return nil;
}
- (void)drawRect:(NSRect)r { - (void)drawRect:(NSRect)r {