Show Parsed Words in compare window
parent
c65c90b0a1
commit
d85eb1b705
|
@ -65,7 +65,12 @@ fun commonWordsTable(
|
||||||
commonWordsHeaderRow()
|
commonWordsHeaderRow()
|
||||||
}
|
}
|
||||||
items(glossaryWords) { word ->
|
items(glossaryWords) { word ->
|
||||||
commonWordsDataRow(word, codeWords, glossaryWordsSet)
|
commonWordsDataRow(word.name, codeWords, glossaryWordsSet)
|
||||||
|
}
|
||||||
|
items(codeWords) { word ->
|
||||||
|
if (word !in glossaryWordsSet) {
|
||||||
|
commonWordsDataRow(word, codeWords, glossaryWordsSet)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -93,7 +98,7 @@ fun commonWordsHeaderRow() {
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun commonWordsDataRow(
|
fun commonWordsDataRow(
|
||||||
word: Word,
|
word: String,
|
||||||
codeWords: List<String>,
|
codeWords: List<String>,
|
||||||
glossaryWordsSet: Set<String>
|
glossaryWordsSet: Set<String>
|
||||||
) {
|
) {
|
||||||
|
@ -102,12 +107,12 @@ fun commonWordsDataRow(
|
||||||
.border(1.dp, Color.Black)
|
.border(1.dp, Color.Black)
|
||||||
.padding(8.dp)
|
.padding(8.dp)
|
||||||
|
|
||||||
val isCommon = word.name in codeWords && word.name in glossaryWordsSet
|
val isCommon = word in codeWords && word in glossaryWordsSet
|
||||||
|
|
||||||
val backgroundColor = when {
|
val backgroundColor = when {
|
||||||
isCommon -> Color.Yellow
|
isCommon -> Color.Yellow
|
||||||
word.name in codeWords -> Color.Blue // Couleur pour les mots du code
|
word in codeWords -> Color.Blue // Couleur pour les mots du code
|
||||||
word.name in glossaryWordsSet -> Color.Green // Couleur pour les mots du glossaire
|
word in glossaryWordsSet -> Color.Green // Couleur pour les mots du glossaire
|
||||||
else -> Color.White
|
else -> Color.White
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,8 +120,8 @@ fun commonWordsDataRow(
|
||||||
modifier = modifier.background(backgroundColor),
|
modifier = modifier.background(backgroundColor),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
cellContent(word.name, modifier)
|
cellContent(word, modifier)
|
||||||
cellContent(if (word.name in codeWords) "Oui" else "Non", modifier)
|
cellContent(if (word in codeWords) "Oui" else "Non", modifier)
|
||||||
cellContent(if (isCommon) "Oui" else "Non", modifier)
|
cellContent(if (isCommon) "Oui" else "Non", modifier)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue