macosx: Declare standard size of small side of scrollbar in VLCLibraryUIUnits

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
This commit is contained in:
Claudio Cambra 2022-12-28 02:43:11 +01:00 committed by Jean-Baptiste Kempf
parent 87ec59473c
commit 32db73190a
3 changed files with 14 additions and 4 deletions

View File

@ -30,6 +30,8 @@ NS_ASSUME_NONNULL_BEGIN
+ (CGFloat)standardSpacing;
+ (CGFloat)smallSpacing;
+ (CGFloat)scrollBarSmallSideSize;
@end
NS_ASSUME_NONNULL_END

View File

@ -39,4 +39,9 @@
return 5;
}
+ (CGFloat)scrollBarSmallSideSize
{
return 16;
}
@end

View File

@ -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;