[vlc-commits] macosx: fix visual appearance of fullscreen tic (refs #8628)

David Fuhrmann git at videolan.org
Tue Jul 23 20:19:12 CEST 2013


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Tue Jul 23 19:37:15 2013 +0200| [863f310d2af8cf471d6919bb4adb67cb4eafc8a0] | committer: David Fuhrmann

macosx: fix visual appearance of fullscreen tic (refs #8628)

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

 modules/gui/macosx/fspanel.m |    7 +++++++
 modules/gui/macosx/misc.h    |    2 ++
 modules/gui/macosx/misc.m    |   33 +++++++++++++++++++--------------
 3 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/modules/gui/macosx/fspanel.m b/modules/gui/macosx/fspanel.m
index de79fa8..e506cec 100644
--- a/modules/gui/macosx/fspanel.m
+++ b/modules/gui/macosx/fspanel.m
@@ -739,5 +739,12 @@
     [self drawKnobInRect: knobRect];
 }
 
+- (void)drawFullVolBezierPath:(NSBezierPath*)bezierPath
+{
+    CGFloat fullVolPos = [self fullVolumePos];
+    [bezierPath moveToPoint:NSMakePoint(fullVolPos, [self frame].size.height)];
+    [bezierPath lineToPoint:NSMakePoint(fullVolPos, 1.)];
+}
+
 @end
 
diff --git a/modules/gui/macosx/misc.h b/modules/gui/macosx/misc.h
index 366d0e9..a5e1374 100644
--- a/modules/gui/macosx/misc.h
+++ b/modules/gui/macosx/misc.h
@@ -129,6 +129,8 @@
 - (void)scrollWheel:(NSEvent *)o_event;
 - (void)drawFullVolumeMarker;
 
+- (CGFloat)fullVolumePos;
+
 @end
 
 /*****************************************************************************
diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index 7e7e54f..24ce840 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -551,8 +551,6 @@ void _drawFrameInRect(NSRect frameRect)
     if (maxAudioVol < 1.)
         return;
 
-    NSRect frame = [self frame];
-
     NSColor *drawingColor;
     // for bright artwork, a black color is used and vice versa
     if (_usesBrightArtwork)
@@ -561,21 +559,28 @@ void _drawFrameInRect(NSRect frameRect)
         drawingColor = [[NSColor whiteColor] colorWithAlphaComponent:.4];
 
     NSBezierPath* bezierPath = [NSBezierPath bezierPath];
-
-    CGFloat sliderRange = frame.size.width - [self knobThickness];
-    CGFloat sliderOrigin = [self knobThickness] / 2.;
-
-    CGFloat fullVolPos = 1. / maxAudioVol * sliderRange + sliderOrigin;
-
-    [bezierPath moveToPoint:NSMakePoint(fullVolPos, frame.size.height - 3.)];
-    [bezierPath lineToPoint:NSMakePoint(fullVolPos, 2.)];
+    [self drawFullVolBezierPath:bezierPath];
     [bezierPath closePath];
 
     bezierPath.lineWidth = 1.;
     [drawingColor setStroke];
     [bezierPath stroke];
-    [drawingColor setFill];
-    [bezierPath fill];
+}
+
+- (CGFloat)fullVolumePos
+{
+    CGFloat maxAudioVol = self.maxValue / AOUT_VOLUME_DEFAULT;
+    CGFloat sliderRange = [self frame].size.width - [self knobThickness];
+    CGFloat sliderOrigin = [self knobThickness] / 2.;
+
+    return 1. / maxAudioVol * sliderRange + sliderOrigin;
+}
+
+- (void)drawFullVolBezierPath:(NSBezierPath*)bezierPath
+{
+    CGFloat fullVolPos = [self fullVolumePos];
+    [bezierPath moveToPoint:NSMakePoint(fullVolPos, [self frame].size.height - 3.)];
+    [bezierPath lineToPoint:NSMakePoint(fullVolPos, 2.)];
 }
 
 @end
@@ -641,7 +646,7 @@ void _drawFrameInRect(NSRect frameRect)
                                  @"NO", @"DisplayTimeAsTimeRemaining",
                                  @"YES", @"DisplayFullscreenTimeAsTimeRemaining",
                                  nil];
-    
+
     [defaults registerDefaults:appDefaults];
 }
 
@@ -651,7 +656,7 @@ void _drawFrameInRect(NSRect frameRect)
         textAlignment = NSCenterTextAlignment;
         o_remaining_identifier = @"";
     }
-    
+
     return self;
 }
 



More information about the vlc-commits mailing list