Skip to content

Commit 44bbe8d

Browse files
committed
ADFA-2448: Keep the signature beside the name when it fits
The Column introduced for the round-3 review put every signature on its own line, so `onDestroy` showed `()` underneath it with most of the row empty. FlowRow keeps name and detail on one line while there is room and wraps the detail only when there is not, which still prevents a long name from squeezing the signature to zero width.
1 parent 01a4300 commit 44bbe8d

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

app/src/main/java/com/itsaky/androidide/ui/outline/OutlinePanel.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ package com.itsaky.androidide.ui.outline
22

33
import androidx.compose.foundation.clickable
44
import androidx.compose.foundation.isSystemInDarkTheme
5+
import androidx.compose.foundation.layout.Arrangement
56
import androidx.compose.foundation.layout.Box
67
import androidx.compose.foundation.layout.Column
8+
import androidx.compose.foundation.layout.ExperimentalLayoutApi
9+
import androidx.compose.foundation.layout.FlowRow
710
import androidx.compose.foundation.layout.Row
811
import androidx.compose.foundation.layout.Spacer
912
import androidx.compose.foundation.layout.fillMaxSize
@@ -147,6 +150,7 @@ private fun OutlineTree(
147150
}
148151
}
149152

153+
@OptIn(ExperimentalLayoutApi::class)
150154
@Composable
151155
private fun OutlineRow(
152156
row: OutlineRowModel,
@@ -210,7 +214,13 @@ private fun OutlineRow(
210214
color = badgeColorFor(symbol.kind),
211215
modifier = Modifier.padding(start = 2.dp, end = 8.dp),
212216
)
213-
Column(modifier = Modifier.weight(1f).padding(vertical = 4.dp)) {
217+
FlowRow(
218+
horizontalArrangement = Arrangement.spacedBy(6.dp),
219+
modifier =
220+
Modifier
221+
.weight(1f)
222+
.padding(vertical = 4.dp),
223+
) {
214224
Text(
215225
text = symbol.name,
216226
style = MaterialTheme.typography.bodyMedium,

0 commit comments

Comments
 (0)