[vlc-commits] macosx: fixed slider knobs in the black ui style

Felix Paul Kühne git at videolan.org
Fri Jan 27 01:17:20 CET 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu Jan 26 20:46:38 2012 +0100| [e3d70d0fe312fe0b13fe77a81cf8c8f8b14d2155] | committer: Jean-Baptiste Kempf

macosx: fixed slider knobs in the black ui style
(cherry picked from commit dc3430bd7b87a601770efa46eacc71719c2778f9)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=e3d70d0fe312fe0b13fe77a81cf8c8f8b14d2155
---

 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