[vlc-commits] [Git][videolan/vlc][master] macosx: Fix top internal constraint for sidebar when using safe area

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Jul 4 19:32:33 UTC 2026



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
912031c8 by Claudio Cambra at 2026-07-04T20:40:28+02:00
macosx: Fix top internal constraint for sidebar when using safe area

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

- - - - -


1 changed file:

- modules/gui/macosx/library/VLCLibraryWindowSidebarRootViewController.m


Changes:

=====================================
modules/gui/macosx/library/VLCLibraryWindowSidebarRootViewController.m
=====================================
@@ -66,9 +66,7 @@
     [self setupPlayQueueTitle];
     [self setupCounterLabel];
 
-    _topInternalConstraint =
-        [self.viewSelector.topAnchor constraintEqualToAnchor:self.view.topAnchor
-                                                    constant:VLCLibraryUIUnits.libraryWindowContentSafeTopInset + VLCLibraryUIUnits.smallSpacing];
+    self.topInternalConstraint.constant = [self topConstraintConstant];
 
     self.mainVideoModeEnabled = NO;
 
@@ -252,10 +250,24 @@
     [self updateTopConstraints];
 }
 
+- (CGFloat)topConstraintConstant
+{
+    CGFloat constant = VLCLibraryUIUnits.smallSpacing;
+    if (@available(macOS 11.0, *)) {
+        // Safe area layout guide already accounts for titlebar height
+        if (!self.mainVideoModeEnabled) {
+            constant += VLCLibraryUIUnits.libraryWindowContentSafeTopInset;
+        }
+    } else if (!self.mainVideoModeEnabled && self.libraryWindow.styleMask & NSWindowStyleMaskFullSizeContentView) {
+        // Compensate for full content view window's titlebar height, prevent top being cut off
+        constant += self.libraryWindow.titlebarHeight;
+    }
+    return constant;
+}
+
 - (void)updateTopConstraints
 {
-    const CGFloat internalTopConstraintConstant =
-        VLCLibraryUIUnits.libraryWindowContentSafeTopInset + VLCLibraryUIUnits.smallSpacing;
+    const CGFloat internalTopConstraintConstant = [self topConstraintConstant];
     self.topInternalConstraint.constant = internalTopConstraintConstant;
     self.playQueueHeaderTopConstraint.constant = internalTopConstraintConstant;
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/912031c86d39c9aae42dbf00ab522e9b0f17881c

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/912031c86d39c9aae42dbf00ab522e9b0f17881c
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list