mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-15 06:27:02 +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,
|
renderMarkdown: @Composable (comment: String, modifier: Modifier) -> Unit,
|
||||||
) {
|
) {
|
||||||
val indentLevel = comment.indentLevel.toInt() - 1
|
val indentLevel = comment.indentLevel.toInt() - 1
|
||||||
val startPadding = ((10 * indentLevel) + 16).dp
|
|
||||||
|
|
||||||
Divider(color = Color.Gray.copy(0.4f))
|
Divider(color = Color.Gray.copy(0.4f))
|
||||||
Row(modifier = Modifier.height(IntrinsicSize.Min)) {
|
Row(modifier = Modifier.height(IntrinsicSize.Min)) {
|
||||||
CommentTreeColors(indentLevel = indentLevel)
|
CommentTreeColors(indentLevel = indentLevel)
|
||||||
Column(
|
Column(modifier = Modifier.padding(start = 12.dp, end = 8.dp, top = 4.dp, bottom = 4.dp)) {
|
||||||
modifier = Modifier.padding(start = startPadding, end = 8.dp, top = 4.dp, bottom = 4.dp)
|
|
||||||
) {
|
|
||||||
SubmitterName(
|
SubmitterName(
|
||||||
text = "Submitted by ${comment.user.username}",
|
text = "Submitted by ${comment.user.username}",
|
||||||
avatarUrl = "https://lobste.rs/${comment.user.avatarUrl}",
|
avatarUrl = "https://lobste.rs/${comment.user.avatarUrl}",
|
||||||
|
@ -72,7 +69,7 @@ private fun CommentTreeColors(
|
||||||
for (level in 1..indentLevel) {
|
for (level in 1..indentLevel) {
|
||||||
Box(
|
Box(
|
||||||
modifier =
|
modifier =
|
||||||
Modifier.padding(start = (level * 12).dp)
|
Modifier.padding(start = (12 + ((level - 1) * 10)).dp)
|
||||||
.fillMaxHeight()
|
.fillMaxHeight()
|
||||||
.width(1.dp)
|
.width(1.dp)
|
||||||
.background(CommentTreeColor[level])
|
.background(CommentTreeColor[level])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue