From 77df8671e64a1f8a394b8e2d1d101d3c4a9001c1 Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Sun, 29 Oct 2023 16:44:23 +0100 Subject: [PATCH] Fixed diff header overlapping the buttons --- .../com/jetpackduba/gitnuro/ui/diff/Diff.kt | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt index 23b662d..8ea8d42 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt @@ -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)