Make the slider gray (#47)

This commit is contained in:
Morten 2019-05-31 19:19:43 +02:00 committed by Sindre Sorhus
parent e4c330bdc1
commit 963ed0b5bb

View file

@ -27,6 +27,8 @@ private final class ToolbarSliderCell: NSSliderCell {
frame.origin.x += shadow.shadowBlurRadius
}
createGreySlider()
NSGraphicsContext.saveGraphicsState()
shadow?.set()
@ -61,6 +63,15 @@ private final class ToolbarSliderCell: NSSliderCell {
super.drawBar(inside: barRect, flipped: flipped)
}
private func createGreySlider() {
var greyFrame = barRect
greyFrame.origin.y = barRect.origin.y + 1
greyFrame.size.height = 3
let greySliderPath = NSBezierPath(roundedRect: greyFrame, xRadius: 1, yRadius: 1)
NSColor.lightGray.setFill()
greySliderPath.fill()
}
}
extension NSSlider {