[vlc-commits] macosx: fixed slider knobs in the black ui style
Felix Paul Kühne
git at videolan.org
Thu Jan 26 20:47:32 CET 2012
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu Jan 26 20:46:38 2012 +0100| [dc3430bd7b87a601770efa46eacc71719c2778f9] | committer: Felix Paul Kühne
macosx: fixed slider knobs in the black ui style
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dc3430bd7b87a601770efa46eacc71719c2778f9
---
modules/gui/macosx/misc.h | 2 ++
modules/gui/macosx/misc.m | 25 ++++++++++++++++++++-----
2 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/modules/gui/macosx/misc.h b/modules/gui/macosx/misc.h
index a055ea4..bfc2d5f 100644
--- a/modules/gui/macosx/misc.h
+++ b/modules/gui/macosx/misc.h
@@ -134,6 +134,8 @@
@interface ITSlider : NSSlider
{
+ NSImage *img;
+ NSRect image_rect;
}
- (void)drawRect:(NSRect)rect;
diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index 1cb31c2..ea3df8d 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -603,7 +603,10 @@ void _drawFrameInRect(NSRect frameRect)
- (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.origin.x = img_rect.origin.y = 0;
}
@@ -650,13 +653,25 @@ void _drawFrameInRect(NSRect frameRect)
@implementation ITSlider
-- (void)drawKnobInRect:(NSRect)knobRect
+- (void)awakeFromNib
{
- NSRect image_rect;
- NSImage *img = [NSImage imageNamed:@"volume-slider-knob"];
+ BOOL b_dark = config_GetInt( VLCIntf, "macosx-interfacestyle" );
+ if (b_dark)
+ img = [NSImage imageNamed:@"volume-slider-knob_dark"];
+ else
+ img = [NSImage imageNamed:@"volume-slider-knob"];
+
image_rect.size = [img size];
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.size.width = image_rect.size.width;
knobRect.size.height = image_rect.size.height;
More information about the vlc-commits
mailing list