From 4c9417e7efb32e582cd251c9f50565deb44b6286 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Sat, 22 Jun 2024 13:06:20 +0800 Subject: [PATCH] macosx: Remove unused custom colouring attributes and procedures in playback progress slider Signed-off-by: Claudio Cambra --- .../views/VLCPlaybackProgressSliderCell.h | 18 ++------------ .../views/VLCPlaybackProgressSliderCell.m | 24 +++---------------- 2 files changed, 5 insertions(+), 37 deletions(-) diff --git a/modules/gui/macosx/views/VLCPlaybackProgressSliderCell.h b/modules/gui/macosx/views/VLCPlaybackProgressSliderCell.h index ad33a5ddd8..bf3e797795 100644 --- a/modules/gui/macosx/views/VLCPlaybackProgressSliderCell.h +++ b/modules/gui/macosx/views/VLCPlaybackProgressSliderCell.h @@ -24,22 +24,8 @@ @interface VLCPlaybackProgressSliderCell : NSSliderCell -// Colors -@property NSColor *gradientColor; -@property NSColor *gradientColor2; -@property NSColor *trackStrokeColor; -@property NSColor *filledTrackColor; -@property NSColor *shadowColor; -@property NSColor *highlightBackground; - -// Gradients -@property NSGradient *trackGradient; -@property NSGradient *highlightGradient; - -@property NSInteger animationWidth; - -@property (nonatomic) BOOL indefinite; -@property (nonatomic) BOOL knobHidden; +@property (readwrite, nonatomic) BOOL indefinite; +@property (readwrite, nonatomic) BOOL knobHidden; - (void)setSliderStyleLight; - (void)setSliderStyleDark; diff --git a/modules/gui/macosx/views/VLCPlaybackProgressSliderCell.m b/modules/gui/macosx/views/VLCPlaybackProgressSliderCell.m index b1a11aa074..161f6a0b40 100644 --- a/modules/gui/macosx/views/VLCPlaybackProgressSliderCell.m +++ b/modules/gui/macosx/views/VLCPlaybackProgressSliderCell.m @@ -35,6 +35,7 @@ @interface VLCPlaybackProgressSliderCell () { + NSInteger _animationWidth; NSInteger _animationPosition; double _lastTime; double _deltaToLastFrame; @@ -68,9 +69,9 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, { self = [super initWithCoder:coder]; if (self) { - [self setSliderStyleLight]; - self.animationWidth = self.controlView.bounds.size.width; + _animationWidth = self.controlView.bounds.size.width; + [self setSliderStyleLight]; [self initDisplayLink]; } return self; @@ -159,26 +160,8 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, #pragma mark - #pragma mark Indefinite slider drawing - -- (void)drawHighlightInRect:(NSRect)rect -{ - [self.highlightGradient drawInRect:rect angle:0]; -} - - -- (void)drawHighlightBackgroundInRect:(NSRect)rect -{ - rect = NSInsetRect(rect, 1.0, 1.0); - NSBezierPath * const fullPath = - [NSBezierPath bezierPathWithRoundedRect:rect xRadius:2.0 yRadius:2.0]; - [self.highlightBackground setFill]; - [fullPath fill]; -} - - (void)drawAnimationInRect:(NSRect)rect { - [self drawHighlightBackgroundInRect:rect]; - [NSGraphicsContext saveGraphicsState]; rect = NSInsetRect(rect, 1.0, 1.0); NSBezierPath * const fullPath = @@ -197,7 +180,6 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, rect.size.width = _animationWidth; - [self drawHighlightInRect:rect]; [NSGraphicsContext restoreGraphicsState]; _deltaToLastFrame = 0; }