🐞 Incorrect focus ring shape for buttons.
Description
Focus ring shape for buttons are incorrect.
For AppKit controls, focus rings for buttons with images automatically get their shape according to the image content, or it could be arbitrarily drawn by implementing NSCell.drawFocusRingMask(withFrame:in:).
For SwiftUI, current I have no idea how to implement such behavior. View.contentShape(_:eoFill:) may help, but unless we have a efficient way to convert SF Symbols to CGPaths. The only article I could find utilizes Vision.framework to do this, which is too heavy I believe.
To Reproduce
- Enable keyboard navigation on system settings.
- Open CodeEdit and see the focus ring shape.
Expected Behavior
Focus rings should be the same shape as the button image.
Version Information
CodeEdit: Version 0.0.3-dev (30) macOS: 13.3 Beta (22E5236f) Xcode: 14.2.1
Additional Context
No response
Screenshots
I certainly agree that the approach using the Vision framework is way too expensive for that matter. Upon some research I couldn't find anything useful either so I suggest we keep this in the backlog for now until SwiftUI enables us to do this properly.