From aa2542e4eb1e2f180bb1685fa587c8231fee4296 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 15 Jan 2024 21:55:11 -0500 Subject: [PATCH] MacPDF: Make Debug menu work when sidebar has focus --- Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.h | 1 + Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.h b/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.h index 92bd2d49773a049..e579318f243f587 100644 --- a/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.h +++ b/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.h @@ -21,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN - (IBAction)goToNextPage:(id)sender; - (IBAction)goToPreviousPage:(id)sender; +- (IBAction)toggleShowClippingPaths:(id)sender; - (IBAction)showGoToPageDialog:(id)sender; - (void)pdfDidInitialize; diff --git a/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm b/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm index 951e869553f4e3e..f84241b4f1af8bf 100644 --- a/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm +++ b/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm @@ -132,6 +132,18 @@ - (IBAction)goToPreviousPage:(id)sender [_pdfView goToPreviousPage:sender]; } +- (BOOL)validateMenuItem:(NSMenuItem*)item +{ + if ( [_pdfView validateMenuItem:item]) + return YES; + return [super validateMenuItem:item]; +} + +- (IBAction)toggleShowClippingPaths:(id)sender +{ + [_pdfView toggleShowClippingPaths:sender]; +} + - (IBAction)showGoToPageDialog:(id)sender { auto alert = [[NSAlert alloc] init];