From 899d48f01af5f34f487f3aa042699a9fc3addcea Mon Sep 17 00:00:00 2001 From: CAPEL Maxime <83071634+fortyup@users.noreply.github.com> Date: Fri, 8 Dec 2023 14:23:23 +0100 Subject: [PATCH] Update color of form and search bar --- src/main/kotlin/main/Detail.kt | 5 +++++ src/main/kotlin/main/Form.kt | 26 ++++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/main/Detail.kt b/src/main/kotlin/main/Detail.kt index 763f3d2..cc64b0b 100644 --- a/src/main/kotlin/main/Detail.kt +++ b/src/main/kotlin/main/Detail.kt @@ -143,6 +143,11 @@ fun glossaryDetailedPage(glossary: List, onBackClick: () -> Unit) { leadingIcon = { Icon(imageVector = Icons.Default.Search, contentDescription = null) }, + colors = TextFieldDefaults.outlinedTextFieldColors( + focusedBorderColor = customRedColor, + cursorColor = customRedColor, + focusedLabelColor = customRedColor, + ), modifier = Modifier .fillMaxWidth() .padding(16.dp) diff --git a/src/main/kotlin/main/Form.kt b/src/main/kotlin/main/Form.kt index 0d1e37b..7a3fe11 100644 --- a/src/main/kotlin/main/Form.kt +++ b/src/main/kotlin/main/Form.kt @@ -5,7 +5,6 @@ import androidx.compose.material.* import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.ArrowBack import androidx.compose.material.icons.filled.Check -import androidx.compose.material.icons.filled.Close import androidx.compose.runtime.Composable import androidx.compose.runtime.MutableState import androidx.compose.runtime.mutableStateOf @@ -44,7 +43,7 @@ fun formPage(onCancelClick: () -> Unit) { Text(text = "Confirmation d'ajout de mot") }, text = { - Text("Le mot a bien été ajouté au glossaire.") + Text("Le mot '${name.value}' a bien été ajouté au glossaire.") }, confirmButton = { Button( @@ -77,6 +76,11 @@ fun formPage(onCancelClick: () -> Unit) { value = name.value, onValueChange = { name.value = it }, label = { Text("Mot *") }, + colors = TextFieldDefaults.textFieldColors( + focusedIndicatorColor = customRedColor, + unfocusedIndicatorColor = Color.Gray, + focusedLabelColor = customRedColor + ) ) TextField( @@ -85,7 +89,8 @@ fun formPage(onCancelClick: () -> Unit) { label = { Text("Description") }, colors = TextFieldDefaults.textFieldColors( focusedIndicatorColor = customRedColor, - unfocusedIndicatorColor = Color.Gray + unfocusedIndicatorColor = Color.Gray, + focusedLabelColor = customRedColor ) ) @@ -95,7 +100,8 @@ fun formPage(onCancelClick: () -> Unit) { label = { Text("Contexte principal *") }, colors = TextFieldDefaults.textFieldColors( focusedIndicatorColor = customRedColor, - unfocusedIndicatorColor = Color.Gray + unfocusedIndicatorColor = Color.Gray, + focusedLabelColor = customRedColor ) ) @@ -105,7 +111,8 @@ fun formPage(onCancelClick: () -> Unit) { label = { Text("Contexte 2") }, colors = TextFieldDefaults.textFieldColors( focusedIndicatorColor = customRedColor, - unfocusedIndicatorColor = Color.Gray + unfocusedIndicatorColor = Color.Gray, + focusedLabelColor = customRedColor ) ) @@ -115,7 +122,8 @@ fun formPage(onCancelClick: () -> Unit) { label = { Text("Lié à") }, colors = TextFieldDefaults.textFieldColors( focusedIndicatorColor = customRedColor, - unfocusedIndicatorColor = Color.Gray + unfocusedIndicatorColor = Color.Gray, + focusedLabelColor = customRedColor ) ) @@ -125,7 +133,8 @@ fun formPage(onCancelClick: () -> Unit) { label = { Text("Synonyme") }, colors = TextFieldDefaults.textFieldColors( focusedIndicatorColor = customRedColor, - unfocusedIndicatorColor = Color.Gray + unfocusedIndicatorColor = Color.Gray, + focusedLabelColor = customRedColor ) ) @@ -135,7 +144,8 @@ fun formPage(onCancelClick: () -> Unit) { label = { Text("Antonyme") }, colors = TextFieldDefaults.textFieldColors( focusedIndicatorColor = customRedColor, - unfocusedIndicatorColor = Color.Gray + unfocusedIndicatorColor = Color.Gray, + focusedLabelColor = customRedColor ) )