Update IHM Compare.kt
parent
d85eb1b705
commit
b61111d1e4
|
@ -59,7 +59,7 @@ fun commonWordsTable(
|
||||||
val glossaryWordsSet = glossaryWords.map { it.name }.toSet()
|
val glossaryWordsSet = glossaryWords.map { it.name }.toSet()
|
||||||
|
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize().padding(16.dp),
|
||||||
content = {
|
content = {
|
||||||
item {
|
item {
|
||||||
commonWordsHeaderRow()
|
commonWordsHeaderRow()
|
||||||
|
@ -81,7 +81,7 @@ fun commonWordsHeaderRow() {
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.background(Color.Gray)
|
.background(customRedColor)
|
||||||
.border(1.dp, Color.Black),
|
.border(1.dp, Color.Black),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
|
@ -104,20 +104,19 @@ fun commonWordsDataRow(
|
||||||
) {
|
) {
|
||||||
val modifier = Modifier
|
val modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.border(1.dp, Color.Black)
|
|
||||||
.padding(8.dp)
|
|
||||||
|
|
||||||
val isCommon = word in codeWords && word in glossaryWordsSet
|
val isCommon = word in codeWords && word in glossaryWordsSet
|
||||||
|
|
||||||
val backgroundColor = when {
|
val backgroundColor = when {
|
||||||
isCommon -> Color.Yellow
|
isCommon -> Color.Green // Couleur pour les mots communs
|
||||||
word in codeWords -> Color.Blue // Couleur pour les mots du code
|
word in codeWords -> Color.Yellow // Couleur pour les mots du code
|
||||||
word in glossaryWordsSet -> Color.Green // Couleur pour les mots du glossaire
|
word in glossaryWordsSet -> Color.White // Couleur pour les mots du glossaire
|
||||||
else -> Color.White
|
else -> Color.White
|
||||||
}
|
}
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
modifier = modifier.background(backgroundColor),
|
modifier = modifier.background(backgroundColor)
|
||||||
|
.border(1.dp, Color.Black),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
cellContent(word, modifier)
|
cellContent(word, modifier)
|
||||||
|
|
Loading…
Reference in New Issue