[vlc-commits] macosx: fixed time slider alignment issue

Felix Paul Kühne git at videolan.org
Tue Jul 3 15:06:20 CEST 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Jul  3 15:06:00 2012 +0200| [20484554dc35aecc15fdb8c492d6a9ad591c5695] | committer: Felix Paul Kühne

macosx: fixed time slider alignment issue

Pointed by Damien

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

 modules/gui/macosx/misc.h |    1 +
 modules/gui/macosx/misc.m |   12 +++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/modules/gui/macosx/misc.h b/modules/gui/macosx/misc.h
index d6137dd..85f0552 100644
--- a/modules/gui/macosx/misc.h
+++ b/modules/gui/macosx/misc.h
@@ -134,6 +134,7 @@
 {
     NSImage *o_knob_img;
     NSRect img_rect;
+    BOOL b_dark;
 }
 - (CGFloat)knobPosition;
 
diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index 1728dbc..de55de2 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -607,10 +607,13 @@ void _drawFrameInRect(NSRect frameRect)
 
 - (void)awakeFromNib
 {
-    if (config_GetInt( VLCIntf, "macosx-interfacestyle" ))
+    if (config_GetInt( VLCIntf, "macosx-interfacestyle" )) {
         o_knob_img = [NSImage imageNamed:@"progression-knob_dark"];
-    else
+        b_dark = YES;
+    } else {
         o_knob_img = [NSImage imageNamed:@"progression-knob"];
+        b_dark = NO;
+    }
     img_rect.size = [o_knob_img size];
     img_rect.origin.x = img_rect.origin.y = 0;
 }
@@ -648,7 +651,10 @@ void _drawFrameInRect(NSRect frameRect)
     [[NSGraphicsContext currentContext] restoreGraphicsState];
 
     NSRect knobRect = [[self cell] knobRectFlipped:NO];
-    knobRect.origin.y+=1;
+    if (b_dark)
+        knobRect.origin.y+=2;
+    else
+        knobRect.origin.y+=1;
     [self drawKnobInRect: knobRect];
 }
 



More information about the vlc-commits mailing list