Browse Source

macosx: Call VLCSliderCell methods directly in VLCSlider

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
pull/141/head
Claudio Cambra 4 years ago
committed by Steve Lhomme
parent
commit
2b153197ed
  1. 3
      modules/gui/macosx/views/VLCSlider.h
  2. 16
      modules/gui/macosx/views/VLCSlider.m

3
modules/gui/macosx/views/VLCSlider.h

@ -30,7 +30,4 @@
/* Indicates if the slider is scrollable with the mouse or trackpad scrollwheel. */
@property (readwrite) BOOL isScrollable;
- (void)setSliderStyleLight;
- (void)setSliderStyleDark;
@end

16
modules/gui/macosx/views/VLCSlider.m

@ -58,7 +58,7 @@ static inline void mouseEnteredOrExited(NSLayoutConstraint *const __unsafe_unret
if (@available(macOS 10.14, *)) {
[self viewDidChangeEffectiveAppearance];
} else {
[self setSliderStyleLight];
[(VLCSliderCell*)self.cell setSliderStyleLight];
}
dispatch_async(dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0), ^(){
@ -140,22 +140,12 @@ static inline void mouseEnteredOrExited(NSLayoutConstraint *const __unsafe_unret
return NO;
}
- (void)setSliderStyleLight
{
[(VLCSliderCell*)[self cell] setSliderStyleLight];
}
- (void)setSliderStyleDark
{
[(VLCSliderCell*)[self cell] setSliderStyleDark];
}
- (void)viewDidChangeEffectiveAppearance
{
if (self.shouldShowDarkAppearance) {
[self setSliderStyleDark];
[(VLCSliderCell*)self.cell setSliderStyleDark];
} else {
[self setSliderStyleLight];
[(VLCSliderCell*)self.cell setSliderStyleLight];
}
}

Loading…
Cancel
Save