From 70c1f979a8ec96ed1bb449da73d8b8b56aaca991 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 30 Oct 2024 20:59:16 +0800 Subject: [PATCH] macosx: Only react to user interaction of the chapters sidebar table view Signed-off-by: Claudio Cambra --- .../UI/VLCLibraryWindowChaptersView.xib | 1 + ...braryWindowChaptersSidebarViewController.h | 2 ++ ...braryWindowChaptersSidebarViewController.m | 22 +++++++++---------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/modules/gui/macosx/UI/VLCLibraryWindowChaptersView.xib b/modules/gui/macosx/UI/VLCLibraryWindowChaptersView.xib index db21b02db562..332f7dcff782 100644 --- a/modules/gui/macosx/UI/VLCLibraryWindowChaptersView.xib +++ b/modules/gui/macosx/UI/VLCLibraryWindowChaptersView.xib @@ -100,6 +100,7 @@ + diff --git a/modules/gui/macosx/library/VLCLibraryWindowChaptersSidebarViewController.h b/modules/gui/macosx/library/VLCLibraryWindowChaptersSidebarViewController.h index f7a939774773..c8ae69afee28 100644 --- a/modules/gui/macosx/library/VLCLibraryWindowChaptersSidebarViewController.h +++ b/modules/gui/macosx/library/VLCLibraryWindowChaptersSidebarViewController.h @@ -37,6 +37,8 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithLibraryWindow:(VLCLibraryWindow *)libraryWindow; +- (IBAction)tableViewAction:(id)sender; + @end NS_ASSUME_NONNULL_END diff --git a/modules/gui/macosx/library/VLCLibraryWindowChaptersSidebarViewController.m b/modules/gui/macosx/library/VLCLibraryWindowChaptersSidebarViewController.m index 53de0b64bdb6..f49e70152cda 100644 --- a/modules/gui/macosx/library/VLCLibraryWindowChaptersSidebarViewController.m +++ b/modules/gui/macosx/library/VLCLibraryWindowChaptersSidebarViewController.m @@ -119,6 +119,17 @@ - (void)updateChapterList self.counterLabel.stringValue = [NSString stringWithFormat:@"%lu", chapterCount]; } +- (IBAction)tableViewAction:(id)sender +{ + VLCPlayerChapter * const selectedChapter = + self.chaptersArrayController.selectedObjects.firstObject; + if (selectedChapter == nil) { + return; + } + + [VLCMain.sharedInstance.playlistController.playerController setTimeFast:selectedChapter.time]; +} + # pragma mark - NSTableView delegation - (NSView *)tableView:(NSTableView *)tableView @@ -149,15 +160,4 @@ - (NSView *)tableView:(NSTableView *)tableView return nil; } -- (void)tableViewSelectionDidChange:(NSNotification *)notification -{ - VLCPlayerChapter * const selectedChapter = - self.chaptersArrayController.selectedObjects.firstObject; - if (selectedChapter == nil) { - return; - } - - [VLCMain.sharedInstance.playlistController.playerController setTimeFast:selectedChapter.time]; -} - @end