macosx: Remove MPSlider
authorMarvin Scholz <epirat07@gmail.com>
Sun, 23 Jul 2017 15:01:52 +0000 (17:01 +0200)
committerMarvin Scholz <epirat07@gmail.com>
Sun, 23 Jul 2017 15:26:06 +0000 (17:26 +0200)
Remove unused MPSlider class

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

index fb3893b..81bc2e4 100644 (file)
 
 @end
 
-
-/*****************************************************************************
- * MPSlider
- *****************************************************************************/
-
-@interface MPSlider : NSSlider
-
-@end
-
 /*****************************************************************************
  * ProgressView
  *****************************************************************************/
index 73e20df..b2cde3d 100644 (file)
 @end
 
 
-/*****************************************************************************
- * MPSlider
- *****************************************************************************/
-@implementation MPSlider
-
-void _drawKnobInRect(NSRect knobRect)
-{
-    // Center knob in given rect
-    knobRect.origin.x += (int)((float)(knobRect.size.width - 7)/2.0);
-    knobRect.origin.y += (int)((float)(knobRect.size.height - 7)/2.0);
-
-    // Draw diamond
-    NSRectFillUsingOperation(NSMakeRect(knobRect.origin.x + 3, knobRect.origin.y + 6, 1, 1), NSCompositeSourceOver);
-    NSRectFillUsingOperation(NSMakeRect(knobRect.origin.x + 2, knobRect.origin.y + 5, 3, 1), NSCompositeSourceOver);
-    NSRectFillUsingOperation(NSMakeRect(knobRect.origin.x + 1, knobRect.origin.y + 4, 5, 1), NSCompositeSourceOver);
-    NSRectFillUsingOperation(NSMakeRect(knobRect.origin.x + 0, knobRect.origin.y + 3, 7, 1), NSCompositeSourceOver);
-    NSRectFillUsingOperation(NSMakeRect(knobRect.origin.x + 1, knobRect.origin.y + 2, 5, 1), NSCompositeSourceOver);
-    NSRectFillUsingOperation(NSMakeRect(knobRect.origin.x + 2, knobRect.origin.y + 1, 3, 1), NSCompositeSourceOver);
-    NSRectFillUsingOperation(NSMakeRect(knobRect.origin.x + 3, knobRect.origin.y + 0, 1, 1), NSCompositeSourceOver);
-}
-
-void _drawFrameInRect(NSRect frameRect)
-{
-    // Draw frame
-    NSRectFillUsingOperation(NSMakeRect(frameRect.origin.x, frameRect.origin.y, frameRect.size.width, 1), NSCompositeSourceOver);
-    NSRectFillUsingOperation(NSMakeRect(frameRect.origin.x, frameRect.origin.y + frameRect.size.height-1, frameRect.size.width, 1), NSCompositeSourceOver);
-    NSRectFillUsingOperation(NSMakeRect(frameRect.origin.x, frameRect.origin.y, 1, frameRect.size.height), NSCompositeSourceOver);
-    NSRectFillUsingOperation(NSMakeRect(frameRect.origin.x+frameRect.size.width-1, frameRect.origin.y, 1, frameRect.size.height), NSCompositeSourceOver);
-}
-
-- (void)drawRect:(NSRect)rect
-{
-    // Draw default to make sure the slider behaves correctly
-    [[NSGraphicsContext currentContext] saveGraphicsState];
-    NSRectClip(NSZeroRect);
-    [super drawRect:rect];
-    [[NSGraphicsContext currentContext] restoreGraphicsState];
-
-    // Full size
-    rect = [self bounds];
-    int diff = (int)(([[self cell] knobThickness] - 7.0)/2.0) - 1;
-    rect.origin.x += diff-1;
-    rect.origin.y += diff;
-    rect.size.width -= 2*diff-2;
-    rect.size.height -= 2*diff;
-
-    // Draw dark
-    NSRect knobRect = [[self cell] knobRectFlipped:NO];
-    [[[NSColor blackColor] colorWithAlphaComponent:0.6] set];
-    _drawFrameInRect(rect);
-    _drawKnobInRect(knobRect);
-
-    // Draw shadow
-    [[[NSColor blackColor] colorWithAlphaComponent:0.1] set];
-    rect.origin.x++;
-    rect.origin.y++;
-    knobRect.origin.x++;
-    knobRect.origin.y++;
-    _drawFrameInRect(rect);
-    _drawKnobInRect(knobRect);
-}
-
-@end
-
 /*****************************************************************************
  * ProgressView
  *****************************************************************************/