[vlc-commits] [Git][videolan/vlc][master] 5 commits: macosx: Add outlet for stack view of audio group header
Marvin Scholz (@ePirat)
gitlab at videolan.org
Tue Aug 5 22:38:59 UTC 2025
Marvin Scholz pushed to branch master at VideoLAN / VLC
Commits:
fc0bf353 by Claudio Cambra at 2025-08-05T22:04:31+00:00
macosx: Add outlet for stack view of audio group header
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
d427addd by Claudio Cambra at 2025-08-05T22:04:31+00:00
macosx: Replace visual effect background with glass effect view
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
ed98730b by Claudio Cambra at 2025-08-05T22:04:31+00:00
macosx: Avoid certain procedures involving appearance in audio group header view on macOS 26
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
69ab0a1b by Claudio Cambra at 2025-08-05T22:04:31+00:00
macosx: Build padding into stack view components of audio group header view
Fixes padding when using glass effect view
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
231f5d40 by Claudio Cambra at 2025-08-05T22:04:31+00:00
macosx: Fix build on macOS <26.0
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
3 changed files:
- modules/gui/macosx/UI/VLCLibraryAudioGroupHeaderView.xib
- modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupHeaderView.h
- modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupHeaderView.m
Changes:
=====================================
modules/gui/macosx/UI/VLCLibraryAudioGroupHeaderView.xib
=====================================
@@ -58,7 +58,6 @@
<constraint firstItem="UDD-gH-RDW" firstAttribute="centerY" secondItem="eE7-fJ-MtS" secondAttribute="centerY" id="7pl-Xu-lre"/>
<constraint firstItem="Baf-bX-D7M" firstAttribute="centerY" secondItem="eE7-fJ-MtS" secondAttribute="centerY" id="AMr-ZS-8Ot"/>
<constraint firstItem="UDD-gH-RDW" firstAttribute="width" secondItem="Baf-bX-D7M" secondAttribute="width" id="N5Y-W0-Y5P"/>
- <constraint firstAttribute="width" constant="157" id="hWf-p4-ES0"/>
</constraints>
<visibilityPriorities>
<integer value="1000"/>
@@ -89,10 +88,12 @@
</textField>
</subviews>
<constraints>
- <constraint firstItem="Yyj-ln-1hz" firstAttribute="leading" secondItem="0Si-IF-hfH" secondAttribute="leading" id="Ci0-Wg-TUY"/>
- <constraint firstItem="8Fd-yT-2AG" firstAttribute="leading" secondItem="0Si-IF-hfH" secondAttribute="leading" id="Kyd-AH-vSN"/>
- <constraint firstAttribute="trailing" secondItem="Yyj-ln-1hz" secondAttribute="trailing" id="LeP-os-gHu"/>
- <constraint firstAttribute="trailing" secondItem="8Fd-yT-2AG" secondAttribute="trailing" id="VyH-Uu-36X"/>
+ <constraint firstAttribute="bottom" secondItem="8Fd-yT-2AG" secondAttribute="bottom" constant="10" id="8tG-XA-Dhe"/>
+ <constraint firstItem="Yyj-ln-1hz" firstAttribute="leading" secondItem="0Si-IF-hfH" secondAttribute="leading" constant="10" id="Ci0-Wg-TUY"/>
+ <constraint firstItem="8Fd-yT-2AG" firstAttribute="leading" secondItem="0Si-IF-hfH" secondAttribute="leading" constant="10" id="Kyd-AH-vSN"/>
+ <constraint firstAttribute="trailing" secondItem="Yyj-ln-1hz" secondAttribute="trailing" constant="10" id="LeP-os-gHu"/>
+ <constraint firstItem="Yyj-ln-1hz" firstAttribute="top" secondItem="0Si-IF-hfH" secondAttribute="top" constant="10" id="VPw-ku-aor"/>
+ <constraint firstAttribute="trailing" secondItem="8Fd-yT-2AG" secondAttribute="trailing" constant="10" id="VyH-Uu-36X"/>
</constraints>
<visibilityPriorities>
<integer value="1000"/>
@@ -108,17 +109,18 @@
<constraint firstAttribute="bottom" secondItem="f5b-qJ-770" secondAttribute="bottom" id="CMu-pV-oNq"/>
<constraint firstItem="f5b-qJ-770" firstAttribute="leading" secondItem="E6K-GD-bgu" secondAttribute="leading" id="Enr-0y-OWJ"/>
<constraint firstItem="f5b-qJ-770" firstAttribute="top" secondItem="E6K-GD-bgu" secondAttribute="top" id="UDS-Of-f99"/>
- <constraint firstItem="0Si-IF-hfH" firstAttribute="top" secondItem="E6K-GD-bgu" secondAttribute="top" constant="10" id="fw0-cv-Ofa"/>
- <constraint firstAttribute="trailing" secondItem="0Si-IF-hfH" secondAttribute="trailing" constant="10" id="mM3-Iy-sSh"/>
+ <constraint firstItem="0Si-IF-hfH" firstAttribute="top" secondItem="E6K-GD-bgu" secondAttribute="top" id="fw0-cv-Ofa"/>
+ <constraint firstAttribute="trailing" secondItem="0Si-IF-hfH" secondAttribute="trailing" id="mM3-Iy-sSh"/>
<constraint firstAttribute="trailing" secondItem="f5b-qJ-770" secondAttribute="trailing" id="qxE-XE-VRb"/>
- <constraint firstAttribute="bottom" secondItem="0Si-IF-hfH" secondAttribute="bottom" constant="10" id="sUV-bu-8ug"/>
- <constraint firstItem="0Si-IF-hfH" firstAttribute="leading" secondItem="E6K-GD-bgu" secondAttribute="leading" constant="10" id="vM8-9F-b9Q"/>
+ <constraint firstAttribute="bottom" secondItem="0Si-IF-hfH" secondAttribute="bottom" id="sUV-bu-8ug"/>
+ <constraint firstItem="0Si-IF-hfH" firstAttribute="leading" secondItem="E6K-GD-bgu" secondAttribute="leading" id="vM8-9F-b9Q"/>
</constraints>
<connections>
<outlet property="backgroundEffectView" destination="f5b-qJ-770" id="ASu-7B-UGN"/>
<outlet property="detailTextField" destination="8Fd-yT-2AG" id="VVh-Xd-Ma1"/>
<outlet property="playButton" destination="UDD-gH-RDW" id="Cvj-Zy-lA5"/>
<outlet property="queueButton" destination="Baf-bX-D7M" id="LXJ-9K-2zU"/>
+ <outlet property="stackView" destination="0Si-IF-hfH" id="QDA-wu-RRB"/>
<outlet property="titleTextField" destination="VGp-RV-Jl4" id="G9K-eO-d5s"/>
</connections>
<point key="canvasLocation" x="-588" y="-314"/>
=====================================
modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupHeaderView.h
=====================================
@@ -35,6 +35,7 @@ extern NSString * const VLCLibraryAudioGroupHeaderViewIdentifier;
@property (readwrite, retain, nonatomic) VLCLibraryRepresentedItem *representedItem;
+ at property (readwrite, weak) IBOutlet NSStackView *stackView;
@property (readwrite, weak) IBOutlet NSTextField *titleTextField;
@property (readwrite, weak) IBOutlet NSTextField *detailTextField;
@property (readwrite, weak) IBOutlet NSButton *playButton;
=====================================
modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupHeaderView.m
=====================================
@@ -24,6 +24,7 @@
#import "extensions/NSColor+VLCAdditions.h"
#import "extensions/NSString+Helpers.h"
+#import "extensions/NSView+VLCAdditions.h"
#import "main/VLCMain.h"
@@ -34,6 +35,14 @@
NSString * const VLCLibraryAudioGroupHeaderViewIdentifier = @"VLCLibraryAudioGroupHeaderViewIdentifier";
+ at interface VLCLibraryAudioGroupHeaderView ()
+
+#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 260000
+ at property NSGlassEffectView *glassBackgroundView API_AVAILABLE(macos(26.0));
+#endif
+
+ at end
+
@implementation VLCLibraryAudioGroupHeaderView
+ (CGSize)defaultHeaderSize
@@ -43,18 +52,33 @@ NSString * const VLCLibraryAudioGroupHeaderViewIdentifier = @"VLCLibraryAudioGro
- (void)awakeFromNib
{
- if (@available(macOS 10.14, *)) {
+ if (@available(macOS 10.14, *))
_playButton.bezelColor = NSColor.VLCAccentColor;
- [NSApplication.sharedApplication addObserver:self
- forKeyPath:@"effectiveAppearance"
- options:NSKeyValueObservingOptionNew
- context:nil];
- }
- self.backgroundEffectView.wantsLayer = YES;
- self.backgroundEffectView.layer.cornerRadius = VLCLibraryUIUnits.smallSpacing;
- self.backgroundEffectView.layer.borderWidth = VLCLibraryUIUnits.borderThickness;
- [self updateColoredAppearance:self.effectiveAppearance];
+ if (@available(macOS 26.0, *)) {
+#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 260000
+ self.glassBackgroundView = [[NSGlassEffectView alloc] initWithFrame:self.backgroundEffectView.frame];
+
+ [self addSubview:self.glassBackgroundView
+ positioned:NSWindowBelow
+ relativeTo:self.backgroundEffectView];
+ [self.glassBackgroundView applyConstraintsToFillSuperview];
+ [self.backgroundEffectView removeFromSuperview];
+ [self.stackView removeFromSuperview];
+ self.glassBackgroundView.contentView = self.stackView;
+#endif
+ } else {
+ if (@available(macOS 10.14, *)) {
+ [NSApplication.sharedApplication addObserver:self
+ forKeyPath:@"effectiveAppearance"
+ options:NSKeyValueObservingOptionNew
+ context:nil];
+ }
+ self.backgroundEffectView.wantsLayer = YES;
+ self.backgroundEffectView.layer.cornerRadius = VLCLibraryUIUnits.smallSpacing;
+ self.backgroundEffectView.layer.borderWidth = VLCLibraryUIUnits.borderThickness;
+ [self updateColoredAppearance:self.effectiveAppearance];
+ }
}
- (void)observeValueForKeyPath:(NSString *)keyPath
@@ -62,7 +86,9 @@ NSString * const VLCLibraryAudioGroupHeaderViewIdentifier = @"VLCLibraryAudioGro
change:(NSDictionary<NSKeyValueChangeKey,id> *)change
context:(void *)context
{
- if ([keyPath isEqualToString:@"effectiveAppearance"]) {
+ if (@available(macOS 26.0, *)) {
+ return;
+ } else if ([keyPath isEqualToString:@"effectiveAppearance"]) {
NSAppearance * const effectiveAppearance = change[NSKeyValueChangeNewKey];
[self updateColoredAppearance:effectiveAppearance];
}
@@ -70,6 +96,9 @@ NSString * const VLCLibraryAudioGroupHeaderViewIdentifier = @"VLCLibraryAudioGro
- (void)updateColoredAppearance:(NSAppearance *)appearance
{
+ if (@available(macOS 26.0, *))
+ return;
+
NSParameterAssert(appearance);
BOOL isDark = NO;
if (@available(macOS 10.14, *)) {
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/bdb08656bf6d373cb74f6376a4fc78e5d28d3453...231f5d4099ca187e5aab8dd7d380d303dc304c44
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/bdb08656bf6d373cb74f6376a4fc78e5d28d3453...231f5d4099ca187e5aab8dd7d380d303dc304c44
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