[vlc-commits] [Git][videolan/vlc][master] macosx: Implement swipe action to remove items from play queue
Steve Lhomme (@robUx4)
gitlab at videolan.org
Mon Jul 7 05:19:59 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
1019535d by Claudio Cambra at 2025-07-07T05:05:34+00:00
macosx: Implement swipe action to remove items from play queue
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
1 changed file:
- modules/gui/macosx/playqueue/VLCPlayQueueDataSource.m
Changes:
=====================================
modules/gui/macosx/playqueue/VLCPlayQueueDataSource.m
=====================================
@@ -22,6 +22,7 @@
#import "VLCPlayQueueDataSource.h"
+#import "extensions/NSString+Helpers.h"
#import "main/VLCMain.h"
#import "playqueue/VLCPlayQueueController.h"
#import "playqueue/VLCPlayQueueTableCellView.h"
@@ -190,6 +191,29 @@ static NSString *VLCPlayQueueCellIdentifier = @"VLCPlayQueueCellIdentifier";
return YES;
}
+- (NSArray<NSTableViewRowAction *> *)tableView:(NSTableView *)tableView
+ rowActionsForRow:(NSInteger)row
+ edge:(NSTableRowActionEdge)edge
+{
+ if (edge == NSTableRowActionEdgeTrailing) {
+ VLCPlayQueueModel * const model = _playQueueController.playQueueModel;
+ VLCPlayQueueItem * const item = [_playQueueController.playQueueModel playQueueItemAtIndex:row];
+ if (item == nil) {
+ return @[];
+ }
+
+ NSTableViewRowAction * const removeAction =
+ [NSTableViewRowAction rowActionWithStyle:NSTableViewRowActionStyleDestructive
+ title:_NS("Remove from Play Queue")
+ handler:^(NSTableViewRowAction *action, NSInteger row) {
+ NSIndexSet * const indices = [NSIndexSet indexSetWithIndex:row];
+ [_playQueueController removeItemsAtIndexes:indices];
+ }];
+ return @[removeAction];
+ }
+ return @[];
+}
+
- (void)scrollToCurrentPlayQueueItem
{
[_tableView scrollRowToVisible:_playQueueController.currentPlayQueueIndex];
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1019535d6bfebfe096a2a9dda91203e9c0958a46
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1019535d6bfebfe096a2a9dda91203e9c0958a46
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list