diff --git a/modules/gui/macosx/library/VLCLibraryUIUnits.h b/modules/gui/macosx/library/VLCLibraryUIUnits.h index de724363b4..1f3e1154ce 100644 --- a/modules/gui/macosx/library/VLCLibraryUIUnits.h +++ b/modules/gui/macosx/library/VLCLibraryUIUnits.h @@ -30,6 +30,8 @@ NS_ASSUME_NONNULL_BEGIN + (CGFloat)standardSpacing; + (CGFloat)smallSpacing; ++ (CGFloat)scrollBarSmallSideSize; + @end NS_ASSUME_NONNULL_END diff --git a/modules/gui/macosx/library/VLCLibraryUIUnits.m b/modules/gui/macosx/library/VLCLibraryUIUnits.m index 3d7a64008b..c57e4717e2 100644 --- a/modules/gui/macosx/library/VLCLibraryUIUnits.m +++ b/modules/gui/macosx/library/VLCLibraryUIUnits.m @@ -39,4 +39,9 @@ return 5; } ++ (CGFloat)scrollBarSmallSideSize +{ + return 16; +} + @end diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m b/modules/gui/macosx/library/VLCLibraryWindow.m index c246aed5ed..630a4235ec 100644 --- a/modules/gui/macosx/library/VLCLibraryWindow.m +++ b/modules/gui/macosx/library/VLCLibraryWindow.m @@ -285,11 +285,14 @@ static void addShadow(NSImageView *__unsafe_unretained imageView) [self setViewForSelectedSegment]; [self repeatStateUpdated:nil]; [self shuffleStateUpdated:nil]; - - const CGFloat scrollViewTopInset = 16.; + + // We want all the insets to look even, and since the scrollbar is transparent, + // we have to compensate for this on the sides where there isn't a scrollbar to + // match up the perceived whitespace on all sides + const CGFloat scrollViewTopInset = [VLCLibraryUIUnits scrollBarSmallSideSize]; const CGFloat scrollViewRightInset = 0.; - const CGFloat scrollViewBottomInset = 16.; - const CGFloat scrollViewLeftInset = 16.; + const CGFloat scrollViewBottomInset = [VLCLibraryUIUnits scrollBarSmallSideSize]; + const CGFloat scrollViewLeftInset = [VLCLibraryUIUnits scrollBarSmallSideSize]; // Need to account for the audio collection switcher at the top const CGFloat audioScrollViewTopInset = scrollViewTopInset + _optionBarView.frame.size.height;