mirror of
https://github.com/sindresorhus/touch-bar-simulator
synced 2025-03-02 14:07:14 +00:00
Make the slider gray (#47)
This commit is contained in:
parent
e4c330bdc1
commit
963ed0b5bb
1 changed files with 11 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue