Fix blue slider (#48)

This commit is contained in:
Morten 2019-07-04 17:23:20 +02:00 committed by Sindre Sorhus
parent 4a4a68ca73
commit 71785b3d85

View file

@ -27,7 +27,15 @@ private final class ToolbarSliderCell: NSSliderCell {
frame.origin.x += shadow.shadowBlurRadius
}
createGreySlider()
// Make the slider grey
var greySliderFrame = barRect
greySliderFrame.origin.x -= 1
greySliderFrame.origin.y = barRect.origin.y + 1
greySliderFrame.size.width = frame.origin.x
greySliderFrame.size.height = 3
let greySliderPath = NSBezierPath(roundedRect: greySliderFrame, xRadius: 1.5, yRadius: 1.5)
NSColor.lightGray.setFill()
greySliderPath.fill()
NSGraphicsContext.saveGraphicsState()
@ -63,15 +71,6 @@ 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 {