mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 17:37:05 +05:30
common: tweak comment tree spacing
This commit is contained in:
parent
87e9c218a2
commit
6272d67024
1 changed files with 2 additions and 5 deletions
|
@ -45,14 +45,11 @@ fun CommentEntry(
|
|||
renderMarkdown: @Composable (comment: String, modifier: Modifier) -> Unit,
|
||||
) {
|
||||
val indentLevel = comment.indentLevel.toInt() - 1
|
||||
val startPadding = ((10 * indentLevel) + 16).dp
|
||||
|
||||
Divider(color = Color.Gray.copy(0.4f))
|
||||
Row(modifier = Modifier.height(IntrinsicSize.Min)) {
|
||||
CommentTreeColors(indentLevel = indentLevel)
|
||||
Column(
|
||||
modifier = Modifier.padding(start = startPadding, end = 8.dp, top = 4.dp, bottom = 4.dp)
|
||||
) {
|
||||
Column(modifier = Modifier.padding(start = 12.dp, end = 8.dp, top = 4.dp, bottom = 4.dp)) {
|
||||
SubmitterName(
|
||||
text = "Submitted by ${comment.user.username}",
|
||||
avatarUrl = "https://lobste.rs/${comment.user.avatarUrl}",
|
||||
|
@ -72,7 +69,7 @@ private fun CommentTreeColors(
|
|||
for (level in 1..indentLevel) {
|
||||
Box(
|
||||
modifier =
|
||||
Modifier.padding(start = (level * 12).dp)
|
||||
Modifier.padding(start = (12 + ((level - 1) * 10)).dp)
|
||||
.fillMaxHeight()
|
||||
.width(1.dp)
|
||||
.background(CommentTreeColor[level])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue