Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix comment indent. Fixes #211 #217

Merged
merged 1 commit into from
Oct 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/main/java/com/jerboa/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ fun calculateCommentOffset(depth: Int?, multiplier: Int): Dp {
return if (depth == null) {
0.dp
} else {
((depth + 1) * multiplier).dp
((depth * multiplier).dp)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import androidx.compose.ui.platform.LocalClipboardManager
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.jerboa.*
import com.jerboa.datatypes.*
import com.jerboa.db.Account
Expand Down Expand Up @@ -124,10 +123,12 @@ fun CommentNode(
account: Account?
) {
val offset = calculateCommentOffset(node.depth, 4)

// The ones with a border on the left need a little extra padding
val offset2 = if (node.depth == null) {
0.dp
} else {
LARGE_PADDING
} else {
XXL_PADDING
}
val borderColor = calculateBorderColor(node.depth)
val commentView = node.commentView
Expand All @@ -150,16 +151,12 @@ fun CommentNode(
start = offset
)
) {
Divider(startIndent = offset2)
Divider()
Column(
modifier = Modifier
.padding(
horizontal = LARGE_PADDING
)
.border(start = border)
modifier = Modifier.border(start = border)
) {
Column(
modifier = Modifier.padding(start = offset2)
modifier = Modifier.padding(start = offset2, end = LARGE_PADDING)
) {
if (showPostAndCommunityContext) {
PostAndCommunityContextHeader(
Expand Down