]> git.sesse.net Git - vlc/commitdiff
macosx: fixed time slider alignment issue
authorFelix Paul Kühne <fkuehne@videolan.org>
Tue, 3 Jul 2012 13:06:00 +0000 (15:06 +0200)
committerFelix Paul Kühne <fkuehne@videolan.org>
Tue, 3 Jul 2012 13:06:00 +0000 (15:06 +0200)
Pointed by Damien

modules/gui/macosx/misc.h
modules/gui/macosx/misc.m

index d6137ddd57a449ec4d901959d88737cd939b3ef2..85f055212121bf9001a408170fb9f92047571dc2 100644 (file)
 {
     NSImage *o_knob_img;
     NSRect img_rect;
+    BOOL b_dark;
 }
 - (CGFloat)knobPosition;
 
index 1728dbc40ca0bd80c36e6179a491679081cac2cd..de55de22e75f962a7be495165398bfdfebe2d947 100644 (file)
@@ -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];
 }