commit 9adda94e6376a30cd9094e95623c8f7044cc06fe
parent 630e02a7823b18643e7007ade39729282a1fe40f
Author: Marc Stibane <marc@taler.net>
Date: Wed, 3 Jan 2024 17:49:37 +0100
button color if disabled
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/TalerWallet1/Views/HelperViews/Buttons.swift b/TalerWallet1/Views/HelperViews/Buttons.swift
@@ -110,8 +110,8 @@ struct TalerButtonStyle: ButtonStyle {
public func makeBody(configuration: ButtonStyle.Configuration) -> some View {
// configuration.role = type == .prominent ? .primary : .normal Only on macOS
MyBigButton(//type: type,
- foreColor: foreColor(type: type, pressed: configuration.isPressed),
- backColor: backColor(type: type, pressed: configuration.isPressed),
+ foreColor: foreColor(type: type, pressed: configuration.isPressed, disabled: disabled),
+ backColor: backColor(type: type, pressed: configuration.isPressed, disabled: disabled),
dimmed: dimmed,
configuration: configuration,
disabled: disabled,
@@ -120,14 +120,14 @@ struct TalerButtonStyle: ButtonStyle {
badge: badge)
}
- func foreColor(type: TalerButtonStyleType, pressed: Bool) -> Color {
+ func foreColor(type: TalerButtonStyleType, pressed: Bool, disabled: Bool) -> Color {
return type == .plain ? WalletColors().fieldForeground : // primary text color
WalletColors().buttonForeColor(pressed: pressed,
disabled: disabled,
prominent: type == .prominent,
balance: type == .balance)
}
- func backColor(type: TalerButtonStyleType, pressed: Bool) -> Color {
+ func backColor(type: TalerButtonStyleType, pressed: Bool, disabled: Bool) -> Color {
return type == .plain && !pressed ? Color.clear :
WalletColors().buttonBackColor(pressed: pressed,
disabled: disabled,