From bd886f12ac98f636999a0a18e440821542a7a9e1 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Mon, 23 Feb 2026 16:36:06 +0800 Subject: [PATCH] macosx: Add property to selectively apply internal padding within audio group table header view Signed-off-by: Claudio Cambra --- .../VLCLibraryAudioGroupTableHeaderView.h | 1 + .../VLCLibraryAudioGroupTableHeaderView.m | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupTableHeaderView.h b/modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupTableHeaderView.h index 0d2e6e1718..700619005e 100644 --- a/modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupTableHeaderView.h +++ b/modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupTableHeaderView.h @@ -31,6 +31,7 @@ extern const CGFloat VLCLibraryAudioGroupTableHeaderViewHeight; @interface VLCLibraryAudioGroupTableHeaderView : NSTableHeaderView @property (nullable, nonatomic) VLCLibraryRepresentedItem *representedItem; +@property (readwrite, nonatomic) BOOL internalPaddingAddedForContentView; - (void)updateWithRepresentedItem:(nullable VLCLibraryRepresentedItem *)representedItem fallbackTitle:(nullable NSString *)fallbackTitle diff --git a/modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupTableHeaderView.m b/modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupTableHeaderView.m index 6de9ebc9b4..c3001701ce 100644 --- a/modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupTableHeaderView.m +++ b/modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupTableHeaderView.m @@ -28,6 +28,7 @@ #import "extensions/NSColor+VLCAdditions.h" #import "extensions/NSFont+VLCAdditions.h" #import "extensions/NSString+Helpers.h" +#import "extensions/NSView+VLCAdditions.h" const CGFloat VLCLibraryAudioGroupTableHeaderViewHeight = 86.f; @@ -164,6 +165,10 @@ const CGFloat VLCLibraryAudioGroupTableHeaderViewHeight = 86.f; - (void)updateBackgroundConstraints { + if (!self.internalPaddingAddedForContentView) { + [self.backgroundView applyConstraintsToFillSuperview]; + return; + } [NSLayoutConstraint activateConstraints:@[ [self.backgroundView.topAnchor constraintEqualToAnchor:self.topAnchor constant:self.backgroundTopInset], [self.backgroundView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor], @@ -171,6 +176,14 @@ const CGFloat VLCLibraryAudioGroupTableHeaderViewHeight = 86.f; [self.backgroundView.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-self.backgroundBottomInset], ]]; } + +- (void)setInternalPaddingAddedForContentView:(BOOL)internalPaddingAddedForContentView +{ + if (_internalPaddingAddedForContentView == internalPaddingAddedForContentView) return; + _internalPaddingAddedForContentView = internalPaddingAddedForContentView; + [self updateBackgroundConstraints]; +} + - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change