mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Add a visible custom focus ring to the standard button style
This commit is contained in:
@@ -22,6 +22,7 @@ public struct CompoundButtonStyle: ButtonStyle {
|
|||||||
@Environment(\.isEnabled) private var isEnabled
|
@Environment(\.isEnabled) private var isEnabled
|
||||||
@Environment(\.colorScheme) private var colorScheme
|
@Environment(\.colorScheme) private var colorScheme
|
||||||
@Environment(\.accessibilityShowButtonShapes) private var accessibilityShowButtonShapes
|
@Environment(\.accessibilityShowButtonShapes) private var accessibilityShowButtonShapes
|
||||||
|
@Environment(\.isFocused) private var isFocused
|
||||||
|
|
||||||
var kind: Kind
|
var kind: Kind
|
||||||
public enum Kind {
|
public enum Kind {
|
||||||
@@ -117,6 +118,11 @@ public struct CompoundButtonStyle: ButtonStyle {
|
|||||||
makeBackground(configuration: configuration)
|
makeBackground(configuration: configuration)
|
||||||
}
|
}
|
||||||
.contentShape(contentShape)
|
.contentShape(contentShape)
|
||||||
|
.overlay {
|
||||||
|
if isFocused {
|
||||||
|
contentShape.stroke(.compound.borderInteractivePrimary, lineWidth: 2)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
|
|||||||
Reference in New Issue
Block a user