Commit e3d70d0f authored by Felix Paul Kühne's avatar Felix Paul Kühne Committed by Jean-Baptiste Kempf

macosx: fixed slider knobs in the black ui style

(cherry picked from commit dc3430bd7b87a601770efa46eacc71719c2778f9)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 3fd82b92
...@@ -134,6 +134,8 @@ ...@@ -134,6 +134,8 @@
@interface ITSlider : NSSlider @interface ITSlider : NSSlider
{ {
NSImage *img;
NSRect image_rect;
} }
- (void)drawRect:(NSRect)rect; - (void)drawRect:(NSRect)rect;
......
...@@ -603,7 +603,10 @@ void _drawFrameInRect(NSRect frameRect) ...@@ -603,7 +603,10 @@ void _drawFrameInRect(NSRect frameRect)
- (void)awakeFromNib - (void)awakeFromNib
{ {
o_knob_img = [NSImage imageNamed:@"progression-knob"]; if (config_GetInt( VLCIntf, "macosx-interfacestyle" ))
o_knob_img = [NSImage imageNamed:@"progression-knob_dark"];
else
o_knob_img = [NSImage imageNamed:@"progression-knob"];
img_rect.size = [o_knob_img size]; img_rect.size = [o_knob_img size];
img_rect.origin.x = img_rect.origin.y = 0; img_rect.origin.x = img_rect.origin.y = 0;
} }
...@@ -650,13 +653,25 @@ void _drawFrameInRect(NSRect frameRect) ...@@ -650,13 +653,25 @@ void _drawFrameInRect(NSRect frameRect)
@implementation ITSlider @implementation ITSlider
- (void)drawKnobInRect:(NSRect)knobRect - (void)awakeFromNib
{ {
NSRect image_rect; BOOL b_dark = config_GetInt( VLCIntf, "macosx-interfacestyle" );
NSImage *img = [NSImage imageNamed:@"volume-slider-knob"]; if (b_dark)
img = [NSImage imageNamed:@"volume-slider-knob_dark"];
else
img = [NSImage imageNamed:@"volume-slider-knob"];
image_rect.size = [img size]; image_rect.size = [img size];
image_rect.origin.x = 0; image_rect.origin.x = 0;
image_rect.origin.y = 0;
if (b_dark)
image_rect.origin.y = -1;
else
image_rect.origin.y = 0;
}
- (void)drawKnobInRect:(NSRect)knobRect
{
knobRect.origin.x += (knobRect.size.width - image_rect.size.width) / 2; knobRect.origin.x += (knobRect.size.width - image_rect.size.width) / 2;
knobRect.size.width = image_rect.size.width; knobRect.size.width = image_rect.size.width;
knobRect.size.height = image_rect.size.height; knobRect.size.height = image_rect.size.height;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment