mirror of
https://github.com/sindresorhus/touch-bar-simulator
synced 2024-12-13 05:52:27 +00:00
Fix blue slider (#48)
This commit is contained in:
parent
4a4a68ca73
commit
71785b3d85
1 changed files with 9 additions and 10 deletions
|
@ -27,7 +27,15 @@ private final class ToolbarSliderCell: NSSliderCell {
|
||||||
frame.origin.x += shadow.shadowBlurRadius
|
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()
|
NSGraphicsContext.saveGraphicsState()
|
||||||
|
|
||||||
|
@ -63,15 +71,6 @@ private final class ToolbarSliderCell: NSSliderCell {
|
||||||
|
|
||||||
super.drawBar(inside: barRect, flipped: flipped)
|
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 {
|
extension NSSlider {
|
||||||
|
|
Loading…
Reference in a new issue