Fixed diff header overlapping the buttons

This commit is contained in:
Abdelilah El Aissaoui 2023-10-29 16:44:23 +01:00
parent f53c306099
commit 77df8671e6
No known key found for this signature in database
GPG key ID: 7587FC860F594869

View file

@ -861,44 +861,46 @@ private fun DiffHeader(
val fileName = diffEntry.fileName
val dirPath: String = diffEntry.parentDirectoryPath
SelectionContainer {
Row {
if (dirPath.isNotEmpty()) {
Text(
text = dirPath.removeSuffix("/"),
style = MaterialTheme.typography.body2,
color = MaterialTheme.colors.onBackgroundSecondary,
maxLines = 1,
softWrap = false,
overflow = TextOverflow.Ellipsis,
fontWeight = FontWeight.Medium,
modifier = Modifier
.weight(1f, false),
)
Box(
modifier = Modifier
.weight(1f, true)
) {
SelectionContainer {
Row() {
if (dirPath.isNotEmpty()) {
Text(
text = dirPath.removeSuffix("/"),
style = MaterialTheme.typography.body2,
color = MaterialTheme.colors.onBackgroundSecondary,
maxLines = 1,
softWrap = false,
overflow = TextOverflow.Ellipsis,
fontWeight = FontWeight.Medium,
modifier = Modifier
.weight(1f, false),
)
Text(
text = "/",
maxLines = 1,
softWrap = false,
style = MaterialTheme.typography.body2,
overflow = TextOverflow.Visible,
color = MaterialTheme.colors.onBackgroundSecondary,
)
}
Text(
text = "/",
maxLines = 1,
softWrap = false,
text = fileName,
style = MaterialTheme.typography.body2,
overflow = TextOverflow.Visible,
color = MaterialTheme.colors.onBackgroundSecondary,
color = MaterialTheme.colors.onBackground,
fontWeight = FontWeight.Medium,
maxLines = 1,
modifier = Modifier.padding(end = 16.dp),
)
}
Text(
text = fileName,
style = MaterialTheme.typography.body2,
color = MaterialTheme.colors.onBackground,
fontWeight = FontWeight.Medium,
maxLines = 1,
modifier = Modifier.padding(end = 16.dp),
)
}
}
Spacer(Modifier.weight(1f, true))
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(16.dp)