Skip to content

Commit fc554cf

Browse files
committed
Update dialog buttons color
1 parent 222588c commit fc554cf

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

app/src/main/java/com/paulcoding/hviewer/ui/component/ConfirmDialog.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import androidx.compose.material3.MaterialTheme
55
import androidx.compose.material3.Text
66
import androidx.compose.material3.TextButton
77
import androidx.compose.runtime.Composable
8+
import androidx.compose.ui.graphics.Color
89
import androidx.compose.ui.res.stringResource
910
import com.paulcoding.hviewer.R
1011

@@ -14,6 +15,8 @@ fun ConfirmDialog(
1415
showDialog: Boolean,
1516
title: String = "",
1617
text: String = "",
18+
confirmColor: Color? = null,
19+
dismissColor: Color? = null,
1720
onDismiss: () -> Unit,
1821
onConfirm: () -> Unit
1922
) {
@@ -26,13 +29,16 @@ fun ConfirmDialog(
2629
TextButton(onClick = { onConfirm() }) {
2730
Text(
2831
stringResource(R.string.confirm),
29-
color = MaterialTheme.colorScheme.primary
32+
color = confirmColor ?: MaterialTheme.colorScheme.error
3033
)
3134
}
3235
},
3336
dismissButton = {
3437
TextButton(onClick = { onDismiss() }) {
35-
Text(stringResource(R.string.cancel), color = MaterialTheme.colorScheme.error)
38+
Text(
39+
stringResource(R.string.cancel),
40+
color = dismissColor ?: MaterialTheme.colorScheme.onBackground
41+
)
3642
}
3743
}
3844
)

app/src/main/java/com/paulcoding/hviewer/ui/page/settings/InputRemoteModal.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ fun InputRemoteModal(
124124
TextButton(onClick = { dismiss() }) {
125125
Text(
126126
stringResource(R.string.cancel),
127-
color = MaterialTheme.colorScheme.error
127+
color = MaterialTheme.colorScheme.onBackground
128128
)
129129
}
130130
Spacer(modifier = Modifier.width(12.dp))

0 commit comments

Comments
 (0)