[vlc-commits] [Git][videolan/vlc][master] 5 commits: macosx: Hide track number depending on defaults for play queue table cell view

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sun Jul 13 17:07:26 UTC 2025



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
f94874a5 by Claudio Cambra at 2025-07-13T16:48:47+00:00
macosx: Hide track number depending on defaults for play queue table cell view

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
25dfefa2 by Claudio Cambra at 2025-07-13T16:48:47+00:00
macosx: Add checkbox to enable/disable showing track number in play queue

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
9f301baf by Claudio Cambra at 2025-07-13T16:48:47+00:00
macosx: Disable displaying of track numbers in play queue by default

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
de40ac03 by Claudio Cambra at 2025-07-13T16:48:47+00:00
macosx: Immediately react to display track number in play queue setting change

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
96887370 by Claudio Cambra at 2025-07-13T16:48:47+00:00
macosx: Implement prepareForReuse in play queue table cell view

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


6 changed files:

- modules/gui/macosx/UI/SimplePreferences.xib
- modules/gui/macosx/main/VLCMain.m
- modules/gui/macosx/playqueue/VLCPlayQueueTableCellView.h
- modules/gui/macosx/playqueue/VLCPlayQueueTableCellView.m
- modules/gui/macosx/preferences/VLCSimplePrefsController.h
- modules/gui/macosx/preferences/VLCSimplePrefsController.m


Changes:

=====================================
modules/gui/macosx/UI/SimplePreferences.xib
=====================================
@@ -62,6 +62,7 @@
                 <outlet property="intf_continueplaybackLabel" destination="3919" id="ZJO-qY-UCq"/>
                 <outlet property="intf_continueplaybackPopup" destination="3920" id="dZ3-SI-SCp"/>
                 <outlet property="intf_displayEndOfPlaybackViewCheckBox" destination="SYi-7I-cKE" id="sTC-Oc-1zX"/>
+                <outlet property="intf_displayTrackNumberPlayQueueCheckBox" destination="QZ2-zA-u6A" id="C0Q-pp-Hx7"/>
                 <outlet property="intf_enableNotificationsCheckbox" destination="3564" id="IIA-ce-g61"/>
                 <outlet property="intf_enableluahttpCheckbox" destination="lpZ-9y-Vfn" id="ieR-ZH-mcd"/>
                 <outlet property="intf_generalSettingsBox" destination="kup-aY-Wqq" id="RsL-yE-DVe"/>
@@ -336,16 +337,28 @@ Gw
                                     <action selector="interfaceSettingChanged:" target="-2" id="NdO-a5-vue"/>
                                 </connections>
                             </button>
+                            <button mirrorLayoutDirectionWhenInternationalizing="always" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="QZ2-zA-u6A">
+                                <rect key="frame" x="15" y="16" width="286" height="18"/>
+                                <buttonCell key="cell" type="check" title="Display album track numbers in play queue" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="I5V-9N-WTo">
+                                    <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="interfaceSettingChanged:" target="-2" id="eDk-ch-tvU"/>
+                                </connections>
+                            </button>
                         </subviews>
                         <constraints>
                             <constraint firstItem="r3P-eU-tEX" firstAttribute="top" secondItem="3892" secondAttribute="bottom" constant="17" id="0lq-Ud-BSO"/>
+                            <constraint firstItem="QZ2-zA-u6A" firstAttribute="leading" secondItem="wFl-aV-3Hn" secondAttribute="leading" constant="17" id="3tY-4q-xya"/>
                             <constraint firstItem="3892" firstAttribute="centerY" secondItem="3900" secondAttribute="centerY" id="I4b-x2-YzY"/>
                             <constraint firstItem="MeC-2c-kJf" firstAttribute="leading" secondItem="r3P-eU-tEX" secondAttribute="leading" id="Oki-bv-W2C"/>
                             <constraint firstItem="3892" firstAttribute="top" secondItem="wFl-aV-3Hn" secondAttribute="top" constant="12" id="QjC-Pr-bJB"/>
                             <constraint firstItem="3892" firstAttribute="leading" secondItem="wFl-aV-3Hn" secondAttribute="leading" constant="17" id="SZk-gE-9Fb"/>
-                            <constraint firstAttribute="bottom" secondItem="MeC-2c-kJf" secondAttribute="bottom" constant="17" id="bAb-M0-dQk"/>
+                            <constraint firstAttribute="bottom" secondItem="QZ2-zA-u6A" secondAttribute="bottom" constant="17" id="TXr-OU-qeV"/>
                             <constraint firstItem="r3P-eU-tEX" firstAttribute="leading" secondItem="wFl-aV-3Hn" secondAttribute="leading" constant="17" id="g2X-29-Ah0"/>
                             <constraint firstItem="3900" firstAttribute="leading" secondItem="3892" secondAttribute="trailing" constant="17" id="h9A-kZ-JjD"/>
+                            <constraint firstItem="QZ2-zA-u6A" firstAttribute="top" secondItem="MeC-2c-kJf" secondAttribute="bottom" constant="17" id="qJf-W5-E9J"/>
                             <constraint firstItem="MeC-2c-kJf" firstAttribute="top" secondItem="r3P-eU-tEX" secondAttribute="bottom" constant="17" id="tWH-LK-QkS"/>
                             <constraint firstAttribute="trailing" secondItem="3900" secondAttribute="trailing" constant="20" id="tlF-b1-Tuz"/>
                         </constraints>


=====================================
modules/gui/macosx/main/VLCMain.m
=====================================
@@ -70,6 +70,7 @@
 #import "playqueue/VLCPlayQueueController.h"
 #import "playqueue/VLCPlayerController.h"
 #import "playqueue/VLCPlayQueueModel.h"
+#import "playqueue/VLCPlayQueueTableCellView.h"
 #import "playqueue/VLCPlaybackContinuityController.h"
 
 #import "preferences/prefs.h"
@@ -346,6 +347,7 @@ static VLCMain *sharedInstance = nil;
     NSUserDefaults * const defaults = NSUserDefaults.standardUserDefaults;
     if ([defaults integerForKey:kVLCPreferencesVersion] != 4) {
         [defaults setBool:YES forKey:VLCPlaybackEndViewEnabledKey];
+        [defaults setBool:NO forKey:VLCDisplayTrackNumberPlayQueueKey];
         [self migrateOldPreferences];
     }
 


=====================================
modules/gui/macosx/playqueue/VLCPlayQueueTableCellView.h
=====================================
@@ -27,6 +27,8 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+extern NSString * const VLCDisplayTrackNumberPlayQueueKey;
+extern NSString * const VLCDisplayTrackNumberPlayQueueSettingChanged;
 
 @interface VLCPlayQueueTableCellView : NSTableCellView
 


=====================================
modules/gui/macosx/playqueue/VLCPlayQueueTableCellView.m
=====================================
@@ -39,6 +39,9 @@
 #import <vlc_common.h>
 #import <vlc_configuration.h>
 
+NSString * const VLCDisplayTrackNumberPlayQueueKey = @"VLCDisplayTrackNumberPlayQueueKey";
+NSString * const VLCDisplayTrackNumberPlayQueueSettingChanged = @"VLCDisplayTrackNumberPlayQueueSettingChanged";
+
 @implementation VLCPlayQueueTableCellView
 
 - (void)dealloc
@@ -46,6 +49,22 @@
     [NSNotificationCenter.defaultCenter removeObserver:self];
 }
 
+- (void)awakeFromNib
+{
+    [super awakeFromNib];
+    [NSNotificationCenter.defaultCenter addObserver:self
+                                           selector:@selector(updateRepresentation)
+                                               name:VLCDisplayTrackNumberPlayQueueSettingChanged
+                                             object:nil];
+}
+
+- (void)prepareForReuse
+{
+    [super prepareForReuse];
+    [self updateFonts];
+    [self updateColouredElements];
+}
+
 - (void)setRepresentsCurrentPlayQueueItem:(BOOL)representsCurrentPlayQueueItem
 {
     _representsCurrentPlayQueueItem = representsCurrentPlayQueueItem;
@@ -72,7 +91,6 @@
 
 - (void)updateColouredElements
 {
-
     self.audioMediaTypeIndicator.textColor = _representsCurrentPlayQueueItem ?
         NSColor.labelColor :
         NSColor.secondaryLabelColor;
@@ -81,6 +99,12 @@
 - (void)setRepresentedPlayQueueItem:(VLCPlayQueueItem *)item
 {
     _representedPlayQueueItem = item;
+    [self updateRepresentation];
+}
+
+- (void)updateRepresentation
+{
+    VLCPlayQueueItem * const item = self.representedPlayQueueItem;
 
     __weak typeof(self) weakSelf = self;
     [VLCLibraryImageCache thumbnailForPlayQueueItem:item withCompletion:^(NSImage * const thumbnail) {
@@ -98,7 +122,7 @@
     NSString *playTitle = item.title;
     if (validTitleString) {
         NSString * const trackNumberString = item.inputItem.trackNumber;
-        if (trackNumberString && trackNumberString.length > 0 && ![trackNumberString isEqualToString:@"0"]) {
+        if ([NSUserDefaults.standardUserDefaults boolForKey:VLCDisplayTrackNumberPlayQueueKey] && trackNumberString && trackNumberString.length > 0 && ![trackNumberString isEqualToString:@"0"]) {
             playTitle = [NSString stringWithFormat:@"%@ · %@", trackNumberString, item.inputItem.title];
         } else {
             playTitle = item.inputItem.title;


=====================================
modules/gui/macosx/preferences/VLCSimplePrefsController.h
=====================================
@@ -113,6 +113,7 @@
 @property (readwrite, weak) IBOutlet NSTextField *intf_languageLabel;
 @property (readwrite, weak) IBOutlet NSButton *intf_statusIconCheckbox;
 @property (readwrite, weak) IBOutlet NSButton *intf_largeFontInListsCheckbox;
+ at property (readwrite, weak) IBOutlet NSButton *intf_displayTrackNumberPlayQueueCheckBox;
 
 // intf pane - control box
 @property (readwrite, weak) IBOutlet NSBox *intf_playbackControlBox;


=====================================
modules/gui/macosx/preferences/VLCSimplePrefsController.m
=====================================
@@ -50,6 +50,7 @@
 #import "library/VLCLibraryController.h"
 #import "library/VLCLibraryModel.h"
 #import "library/VLCLibraryDataTypes.h"
+#import "playqueue/VLCPlayQueueTableCellView.h"
 #import "views/VLCPlaybackEndViewController.h"
 
 static struct {
@@ -404,6 +405,7 @@ create_toolbar_item(NSString *itemIdent, NSString *name, NSString *desc, NSStrin
     [_intf_displayEndOfPlaybackViewCheckBox setTitle:_NS("Display end of playback view")];
     [_intf_statusIconCheckbox setTitle: _NS("Display VLC status menu icon")];
     [_intf_largeFontInListsCheckbox setTitle: _NS("Use large text for list views")];
+    [_intf_displayTrackNumberPlayQueueCheckBox setTitle: _NS("Display album track numbers in play queue")];
 
     [_intf_playbackBehaviourBox setTitle:_NS("Playback behaviour")];
     [_intf_enableNotificationsCheckbox setTitle: _NS("Enable notifications on play queue item change")];
@@ -631,6 +633,8 @@ create_toolbar_item(NSString *itemIdent, NSString *name, NSString *desc, NSStrin
 
     self.intf_displayEndOfPlaybackViewCheckBox.state = [defaults boolForKey:VLCPlaybackEndViewEnabledKey] ? NSControlStateValueOn : NSControlStateValueOff;
 
+    self.intf_displayTrackNumberPlayQueueCheckBox.state = [defaults boolForKey:VLCDisplayTrackNumberPlayQueueKey] ? NSControlStateValueOn : NSControlStateValueOff;
+
     [self setupButton:_intf_statusIconCheckbox forBoolValue: "macosx-statusicon"];
 
     [self setupButton:_video_nativeFullscreenCheckbox forBoolValue: "macosx-nativefullscreenmode"];
@@ -957,8 +961,16 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
         [defaults setObject:toNSStr(language_map[index].iso) forKey:@"language"];
         [VLCSimplePrefsController updateRightToLeftSettings];
 
+        const BOOL originalDisplayTrackNumberSetting = [defaults boolForKey:VLCDisplayTrackNumberPlayQueueKey];
+
         [defaults setBool:self.intf_displayEndOfPlaybackViewCheckBox.state == NSControlStateValueOn
                    forKey:VLCPlaybackEndViewEnabledKey];
+        [defaults setBool:self.intf_displayTrackNumberPlayQueueCheckBox.state == NSControlStateValueOn
+                   forKey:VLCDisplayTrackNumberPlayQueueKey];
+        
+        if (originalDisplayTrackNumberSetting != [defaults boolForKey:VLCDisplayTrackNumberPlayQueueKey]) {
+            [NSNotificationCenter.defaultCenter postNotificationName:VLCDisplayTrackNumberPlayQueueSettingChanged object:nil];
+        }
 
         config_PutInt("metadata-network-access", [_intf_artCheckbox state]);
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ef211e7a79eef87c3c8be39f430bf008b7aaee87...96887370e00e1e2e68110dfa6953eee606865d0b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ef211e7a79eef87c3c8be39f430bf008b7aaee87...96887370e00e1e2e68110dfa6953eee606865d0b
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