Browse Source

macosx: Remove unused custom colouring attributes and procedures in playback progress slider

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
pull/163/head
Claudio Cambra 2 years ago
committed by Felix Paul Kühne
parent
commit
4c9417e7ef
  1. 18
      modules/gui/macosx/views/VLCPlaybackProgressSliderCell.h
  2. 24
      modules/gui/macosx/views/VLCPlaybackProgressSliderCell.m

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

24
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;
}

Loading…
Cancel
Save