This commit is contained in:
2026-10-10 14:54:39 +02:00
parent a0b3ef9975
commit 499fcd12ca
27 changed files with 435 additions and 46 deletions
+5 -1
View File
@@ -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 } }
}
}