update toggle shadows for disabled
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
f73de3734b
commit
970ea12bc2
@ -145,20 +145,7 @@ open class ToggleView: Control, Changeable {
|
|||||||
// Update shadow layers frames to match the view's bounds
|
// Update shadow layers frames to match the view's bounds
|
||||||
knobView.layer.insertSublayer(shadowLayer1, at: 0)
|
knobView.layer.insertSublayer(shadowLayer1, at: 0)
|
||||||
knobView.layer.insertSublayer(shadowLayer2, at: 0)
|
knobView.layer.insertSublayer(shadowLayer2, at: 0)
|
||||||
|
|
||||||
let shadowColor = VDSColor.paletteBlack.cgColor
|
|
||||||
shadowLayer1.cornerRadius = knobView.layer.cornerRadius
|
|
||||||
shadowLayer1.shadowColor = shadowColor
|
|
||||||
shadowLayer1.shadowOpacity = 0.24
|
|
||||||
shadowLayer1.shadowOffset = .init(width: 0, height: 1)
|
|
||||||
shadowLayer1.shadowRadius = 5.0
|
|
||||||
|
|
||||||
shadowLayer2.cornerRadius = knobView.layer.cornerRadius
|
|
||||||
shadowLayer2.shadowColor = shadowColor
|
|
||||||
shadowLayer2.shadowOpacity = 0.08
|
|
||||||
shadowLayer2.shadowOffset = .init(width: 0, height: 2)
|
|
||||||
shadowLayer2.shadowRadius = 2.0
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Resets to default settings.
|
/// Resets to default settings.
|
||||||
@ -246,6 +233,19 @@ open class ToggleView: Control, Changeable {
|
|||||||
|
|
||||||
shadowLayer1.frame = knobView.bounds
|
shadowLayer1.frame = knobView.bounds
|
||||||
shadowLayer2.frame = knobView.bounds
|
shadowLayer2.frame = knobView.bounds
|
||||||
|
|
||||||
|
let shadowColor = isEnabled ? VDSColor.paletteBlack.cgColor : VDSColor.paletteGray95.cgColor
|
||||||
|
shadowLayer1.cornerRadius = knobView.layer.cornerRadius
|
||||||
|
shadowLayer1.shadowColor = shadowColor
|
||||||
|
shadowLayer1.shadowOpacity = isEnabled ? 0.24 : 0.1
|
||||||
|
shadowLayer1.shadowOffset = .init(width: 0, height: 1)
|
||||||
|
shadowLayer1.shadowRadius = isEnabled ? 5.0 : 10.0
|
||||||
|
|
||||||
|
shadowLayer2.cornerRadius = knobView.layer.cornerRadius
|
||||||
|
shadowLayer2.shadowColor = shadowColor
|
||||||
|
shadowLayer2.shadowOpacity = isEnabled ? 0.08 : 0.04
|
||||||
|
shadowLayer2.shadowOffset = .init(width: 0, height: 2)
|
||||||
|
shadowLayer2.shadowRadius = 2.0
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user