[vlc-commits] macosx: Improve drawing of VLCHUDButtonCell

Marvin Scholz git at videolan.org
Tue Jul 19 17:25:09 CEST 2016


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Tue Jul 19 17:24:51 2016 +0200| [d4bb29cfa3a42e9efd8fcfa1d15d338f299a48d0] | committer: Marvin Scholz

macosx: Improve drawing of VLCHUDButtonCell

The outline was too thin and the mini control was actually larger
than the small control for some reason.

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

 modules/gui/macosx/VLCHUDButtonCell.m |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/VLCHUDButtonCell.m b/modules/gui/macosx/VLCHUDButtonCell.m
index f042510..78c234c 100644
--- a/modules/gui/macosx/VLCHUDButtonCell.m
+++ b/modules/gui/macosx/VLCHUDButtonCell.m
@@ -76,7 +76,13 @@
 
 - (void) drawRoundRectButtonBezelInRect:(NSRect)rect
 {
-    NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:8.0 yRadius:8.0];
+    NSBezierPath *path;
+    if (self.controlSize == NSMiniControlSize) {
+        rect = NSInsetRect(rect, 1.0, 2.0);
+        path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:3.0 yRadius:3.0];
+    } else {
+        path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:8.0 yRadius:8.0];
+    }
     if (self.highlighted) {
         [_pushedGradient drawInBezierPath:path angle:90.0f];
     } else if (!self.enabled) {
@@ -85,7 +91,7 @@
         [_normalGradient drawInBezierPath:path angle:90.0f];
     }
     [[NSColor colorWithCalibratedWhite:1.0 alpha:1.0] setStroke];
-    [path setLineWidth:0.5];
+    [path setLineWidth:1.0];
     [path stroke];
 }
 



More information about the vlc-commits mailing list