[vlc-commits] [Git][videolan/vlc][master] 2 commits: macosx: Re-add a border, but more sutbly, to VLCImageView
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Fri Jun 2 01:26:01 UTC 2023
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
2d1af5bc by Claudio Cambra at 2023-06-02T01:03:22+00:00
macosx: Re-add a border, but more sutbly, to VLCImageView
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
41d5ceda by Claudio Cambra at 2023-06-02T01:03:22+00:00
macosx: Move border colour to NSColour extension as class property
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
3 changed files:
- modules/gui/macosx/extensions/NSColor+VLCAdditions.h
- modules/gui/macosx/extensions/NSColor+VLCAdditions.m
- modules/gui/macosx/views/VLCImageView.m
Changes:
=====================================
modules/gui/macosx/extensions/NSColor+VLCAdditions.h
=====================================
@@ -44,6 +44,8 @@ NS_ASSUME_NONNULL_BEGIN
+ (instancetype)VLCSliderLightBackgroundColor;
+ (instancetype)VLCSliderDarkBackgroundColor;
+ at property (class, readonly) NSColor *VLCSubtleBorderColor;
+
@end
NS_ASSUME_NONNULL_END
=====================================
modules/gui/macosx/extensions/NSColor+VLCAdditions.m
=====================================
@@ -114,4 +114,9 @@
return [NSColor colorWithCalibratedWhite:1 alpha:0.2];
}
++ (NSColor *)VLCSubtleBorderColor
+{
+ return [NSColor colorWithWhite:0 alpha:0.1];
+}
+
@end
=====================================
modules/gui/macosx/views/VLCImageView.m
=====================================
@@ -56,6 +56,8 @@
- (void)setupLayer
{
self.layer = [[CALayer alloc] init];
+ self.layer.borderColor = NSColor.VLCSubtleBorderColor.CGColor;
+
self.contentGravity = VLCImageViewContentGravityResizeAspectFill;
self.wantsLayer = YES;
[self setCropsImagesToRoundedCorners:YES];
@@ -66,9 +68,11 @@
if (cropsImagesToRoundedCorners) {
self.layer.cornerRadius = 5.;
self.layer.masksToBounds = YES;
+ self.layer.borderWidth = 1.;
} else {
self.layer.cornerRadius = 0.;
self.layer.masksToBounds = NO;
+ self.layer.borderWidth = 0.;
}
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ddf30060ea25a9dfbbbf9061efcd9acc253b5875...41d5cedac22aabc47f802abbf5e3e50ba5dd1fa5
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ddf30060ea25a9dfbbbf9061efcd9acc253b5875...41d5cedac22aabc47f802abbf5e3e50ba5dd1fa5
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