From dcf758acc5480c5b5b835905b98a63b6d4b0dddf Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Fri, 9 Feb 2018 21:40:09 -0800 Subject: [PATCH] Pass menuForEvent: to the enclosing tableview. This gets contextual menus to appear in e timeline. --- .../RSTextDrawing/RSTextDrawing/RSMultiLineView.m | 11 +++++++++++ .../RSTextDrawing/RSTextDrawing/RSSingleLineView.m | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/Frameworks/RSTextDrawing/RSTextDrawing/RSMultiLineView.m b/Frameworks/RSTextDrawing/RSTextDrawing/RSMultiLineView.m index ea9ec342c..27107e720 100644 --- a/Frameworks/RSTextDrawing/RSTextDrawing/RSMultiLineView.m +++ b/Frameworks/RSTextDrawing/RSTextDrawing/RSMultiLineView.m @@ -6,6 +6,7 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // +@import RSCore; #import "RSMultiLineView.h" #import "RSMultiLineRenderer.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 { if (self.selected) { diff --git a/Frameworks/RSTextDrawing/RSTextDrawing/RSSingleLineView.m b/Frameworks/RSTextDrawing/RSTextDrawing/RSSingleLineView.m index af7d442ce..7830563fe 100644 --- a/Frameworks/RSTextDrawing/RSTextDrawing/RSSingleLineView.m +++ b/Frameworks/RSTextDrawing/RSTextDrawing/RSSingleLineView.m @@ -124,6 +124,14 @@ static NSAttributedString *emptyAttributedString = nil; return self.intrinsicSize; } +- (NSMenu *)menuForEvent:(NSEvent *)event { + + NSTableView *tableView = [self rs_enclosingTableView]; + if (tableView) { + return [tableView menuForEvent:event]; + } + return nil; +} - (void)drawRect:(NSRect)r {