[vlc-devel] [VLC 3.x 03/11] macosx: Ensure title item is always added to table
Marvin Scholz
epirat07 at gmail.com
Wed Aug 26 00:50:09 CEST 2020
Previously it was possible that the table ended up without the title
item in some rare cases and impossible for the user to enable it again
in the menu.
(cherry picked from commit 2125f01b0b0aaf8ca882c6287cb66c4cdf38f6ae)
Signed-off-by: Marvin Scholz <epirat07 at gmail.com>
---
modules/gui/macosx/VLCPlaylist.m | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/modules/gui/macosx/VLCPlaylist.m b/modules/gui/macosx/VLCPlaylist.m
index 36655f8f27..0f9d00c46d 100644
--- a/modules/gui/macosx/VLCPlaylist.m
+++ b/modules/gui/macosx/VLCPlaylist.m
@@ -203,6 +203,8 @@ - (void)setPlaylistHeaderView:(NSTableHeaderView * __nullable)playlistHeaderView
NSArray *columnArray = [[NSUserDefaults standardUserDefaults] arrayForKey:@"PlaylistColumnSelection"];
+ BOOL hasTitleItem = NO;
+
for (NSArray *column in columnArray) {
NSString *columnName = column[0];
NSNumber *columnWidth = column[1];
@@ -210,11 +212,20 @@ - (void)setPlaylistHeaderView:(NSTableHeaderView * __nullable)playlistHeaderView
if ([columnName isEqualToString:@"status"])
continue;
+ // Memorize if we custom set always-enabled title item
+ if ([columnName isEqualToString:TITLE_COLUMN]) {
+ hasTitleItem = YES;
+ }
+
if(![self setPlaylistColumnTableState: NSOnState forColumn:columnName])
continue;
[[_outlineView tableColumnWithIdentifier:columnName] setWidth:[columnWidth floatValue]];
}
+
+ // Set the always enabled title item if not already done
+ if (!hasTitleItem)
+ [self setPlaylistColumnTableState:NSOnState forColumn:TITLE_COLUMN];
}
- (void)applicationWillTerminate:(NSNotification *)notification
--
2.24.3 (Apple Git-128)
More information about the vlc-devel
mailing list