@@ -14,18 +14,17 @@ import androidx.compose.runtime.Composable
14
14
import androidx.compose.ui.Modifier
15
15
import androidx.compose.ui.draw.alpha
16
16
import androidx.compose.ui.graphics.Color
17
- import androidx.compose.ui.graphics.compositeOver
18
17
import androidx.compose.ui.text.style.TextAlign
19
18
import androidx.compose.ui.text.style.TextOverflow
20
19
import androidx.compose.ui.tooling.preview.Preview
21
20
import androidx.compose.ui.unit.dp
22
21
import net.mullvad.mullvadvpn.lib.theme.AppTheme
23
22
import net.mullvad.mullvadvpn.lib.theme.Dimens
24
23
import net.mullvad.mullvadvpn.lib.theme.color.Alpha20
25
- import net.mullvad.mullvadvpn.lib.theme.color.AlphaInactive
26
24
import net.mullvad.mullvadvpn.lib.theme.color.AlphaInvisible
27
- import net.mullvad.mullvadvpn.lib.theme.color.onVariant
28
- import net.mullvad.mullvadvpn.lib.theme.color.variant
25
+ import net.mullvad.mullvadvpn.lib.theme.color.errorDisabled
26
+ import net.mullvad.mullvadvpn.lib.theme.color.primaryDisabled
27
+ import net.mullvad.mullvadvpn.lib.theme.color.tertiaryDisabled
29
28
30
29
@Preview
31
30
@Composable
@@ -72,14 +71,8 @@ fun NegativeButton(
72
71
ButtonDefaults .buttonColors(
73
72
containerColor = MaterialTheme .colorScheme.error,
74
73
contentColor = MaterialTheme .colorScheme.onError,
75
- disabledContentColor =
76
- MaterialTheme .colorScheme.onError
77
- .copy(alpha = AlphaInactive )
78
- .compositeOver(MaterialTheme .colorScheme.background),
79
- disabledContainerColor =
80
- MaterialTheme .colorScheme.error
81
- .copy(alpha = AlphaInactive )
82
- .compositeOver(MaterialTheme .colorScheme.background),
74
+ disabledContentColor = MaterialTheme .colorScheme.onError.copy(alpha = Alpha20 ),
75
+ disabledContainerColor = MaterialTheme .colorScheme.errorDisabled
83
76
),
84
77
isEnabled : Boolean = true,
85
78
icon : @Composable (() -> Unit )? = null
@@ -99,19 +92,13 @@ fun VariantButton(
99
92
onClick : () -> Unit ,
100
93
text : String ,
101
94
modifier : Modifier = Modifier ,
102
- background : Color = MaterialTheme .colorScheme.background ,
95
+ background : Color = MaterialTheme .colorScheme.tertiary ,
103
96
colors : ButtonColors =
104
97
ButtonDefaults .buttonColors(
105
- containerColor = MaterialTheme .colorScheme.variant,
106
- contentColor = MaterialTheme .colorScheme.onVariant,
107
- disabledContentColor =
108
- MaterialTheme .colorScheme.onVariant
109
- .copy(alpha = AlphaInactive )
110
- .compositeOver(background),
111
- disabledContainerColor =
112
- MaterialTheme .colorScheme.variant
113
- .copy(alpha = AlphaInactive )
114
- .compositeOver(background),
98
+ containerColor = background,
99
+ contentColor = MaterialTheme .colorScheme.onTertiary,
100
+ disabledContentColor = MaterialTheme .colorScheme.onTertiary.copy(alpha = Alpha20 ),
101
+ disabledContainerColor = MaterialTheme .colorScheme.tertiaryDisabled,
115
102
),
116
103
isEnabled : Boolean = true,
117
104
icon : @Composable (() -> Unit )? = null
@@ -135,14 +122,8 @@ fun PrimaryButton(
135
122
ButtonDefaults .buttonColors(
136
123
containerColor = MaterialTheme .colorScheme.primary,
137
124
contentColor = MaterialTheme .colorScheme.onPrimary,
138
- disabledContentColor =
139
- MaterialTheme .colorScheme.onPrimary
140
- .copy(alpha = Alpha20 )
141
- .compositeOver(MaterialTheme .colorScheme.background),
142
- disabledContainerColor =
143
- MaterialTheme .colorScheme.primary
144
- .copy(alpha = AlphaInactive )
145
- .compositeOver(MaterialTheme .colorScheme.background),
125
+ disabledContentColor = MaterialTheme .colorScheme.onPrimary.copy(alpha = Alpha20 ),
126
+ disabledContainerColor = MaterialTheme .colorScheme.primaryDisabled,
146
127
),
147
128
isEnabled : Boolean = true,
148
129
leadingIcon : @Composable (() -> Unit )? = null,
0 commit comments