Skip to content

A rootless Android app that boots Alpine Linux: run containers (Podman/Docker/LXC) and GUI desktop apps.

fix(ui): keep list-row labels readable and chip rows stable

ExTveca486d4d080
diff --git a/app/src/main/java/com/excp/podroid/ui/components/PodroidListRow.kt b/app/src/main/java/com/excp/podroid/ui/components/PodroidListRow.kt
index 1e08332..76cfc65 100644
--- a/app/src/main/java/com/excp/podroid/ui/components/PodroidListRow.kt
+++ b/app/src/main/java/com/excp/podroid/ui/components/PodroidListRow.kt
@@ -14,6 +14,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontFamily
+import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.excp.podroid.ui.theme.PodroidTokens
@@ -60,6 +61,10 @@ fun PodroidListRow(
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant,
fontFamily = if (mono) PodroidTokens.mono() else FontFamily.Default,
+ textAlign = TextAlign.End,
+ // fill = false: a short value still hugs the right edge via SpaceBetween;
+ // a long value wraps inside the leftover space instead of starving the label.
+ modifier = Modifier.weight(1f, fill = false),
)
if (trailing != null) {
Spacer(Modifier.width(PodroidTokens.Spacing.SM))
diff --git a/app/src/main/java/com/excp/podroid/ui/components/VmResourceChips.kt b/app/src/main/java/com/excp/podroid/ui/components/VmResourceChips.kt
index eab1733..6848be6 100644
--- a/app/src/main/java/com/excp/podroid/ui/components/VmResourceChips.kt
+++ b/app/src/main/java/com/excp/podroid/ui/components/VmResourceChips.kt
@@ -15,7 +15,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
-import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.excp.podroid.R
import com.excp.podroid.ui.theme.PodroidTokens
@@ -53,12 +52,7 @@ fun VmRamChips(
selected = mb == currentMb,
enabled = enabled,
onClick = { onChange(mb) },
- label = {
- Text(
- formatRam(mb),
- fontWeight = if (mb == currentMb) FontWeight.Bold else FontWeight.Normal,
- )
- },
+ label = { Text(formatRam(mb)) },
shape = RoundedCornerShape(PodroidTokens.Radius.Chip),
colors = PodroidChipColors(),
)
@@ -102,12 +96,7 @@ fun VmCpuChips(
selected = n == currentCpus,
enabled = enabled,
onClick = { onChange(n) },
- label = {
- Text(
- "$n",
- fontWeight = if (n == currentCpus) FontWeight.Bold else FontWeight.Normal,
- )
- },
+ label = { Text("$n") },
shape = RoundedCornerShape(PodroidTokens.Radius.Chip),
colors = PodroidChipColors(),
)
@@ -164,12 +153,7 @@ fun VmStorageChips(
selected = gb == currentGb,
enabled = enabled && gb >= minGb,
onClick = { onChange(gb) },
- label = {
- Text(
- "$gb GB",
- fontWeight = if (gb == currentGb) FontWeight.Bold else FontWeight.Normal,
- )
- },
+ label = { Text("$gb GB") },
shape = RoundedCornerShape(PodroidTokens.Radius.Chip),
colors = PodroidChipColors(),
)
@@ -219,12 +203,7 @@ fun VmBandwidthChips(
selected = mbps == currentMbps,
enabled = enabled,
onClick = { onChange(mbps) },
- label = {
- Text(
- formatBandwidth(mbps),
- fontWeight = if (mbps == currentMbps) FontWeight.Bold else FontWeight.Normal,
- )
- },
+ label = { Text(formatBandwidth(mbps)) },
shape = RoundedCornerShape(PodroidTokens.Radius.Chip),
colors = PodroidChipColors(),
)