cursor
This commit is contained in:
@@ -17,6 +17,7 @@ public struct PrimaryButtonStyle: ButtonStyle {
|
||||
.padding(.vertical, 6)
|
||||
.background(destructive ? Palette.amberDeep : Palette.amber, in: RoundedRectangle(cornerRadius: Metrics.radiusSmall))
|
||||
.contentShape(Rectangle())
|
||||
.pointerHand()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +43,7 @@ private struct SecondaryButtonBody: View {
|
||||
.background(isHovered || configuration.isPressed ? Palette.hover : .clear, in: RoundedRectangle(cornerRadius: Metrics.radiusSmall))
|
||||
.overlay(RoundedRectangle(cornerRadius: Metrics.radiusSmall).strokeBorder(Palette.raised, lineWidth: Metrics.hairline))
|
||||
.contentShape(Rectangle())
|
||||
.pointerHand()
|
||||
.onHover { isHovered = $0 }
|
||||
.animation(Metrics.smallControlTransition, value: isHovered)
|
||||
}
|
||||
@@ -84,6 +86,8 @@ extension View {
|
||||
|
||||
/// Disabled is 40% opacity and nothing else: no recolouring.
|
||||
public func disabledLook(_ isDisabled: Bool) -> some View {
|
||||
opacity(isDisabled ? 0.4 : 1).allowsHitTesting(!isDisabled)
|
||||
opacity(isDisabled ? 0.4 : 1)
|
||||
.allowsHitTesting(!isDisabled)
|
||||
.transformEnvironment(\.allowsPointerHand) { if isDisabled { $0 = false } }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user