From 265335d5505d0e745b621c893c8bdc4f7507bcde Mon Sep 17 00:00:00 2001 From: MaxsTechReview Date: Fri, 30 Oct 2026 00:09:53 -0400 Subject: [PATCH] fix: the Stop button no longer wraps letter by letter on narrow bottom screens (#1805) --- .../java/com/droiddeck/launcher/ui/SessionOverlay.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt b/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt index c47439bc03..5f165eeb01 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt @@ -856,6 +856,8 @@ private fun StopSessionButton(modifier: Modifier = Modifier, onClick: () -> Unit val fill by animateColorAsState(if (hot) colors.error.copy(alpha = 0.18f) else Color.Transparent, Motion.tw(220), label = "dangerFill") val shape = RoundedCornerShape(20.dp) val stopDescription = stringResource(R.string.stop_session) + val stopLabel = stringResource(R.string.drawer_stop) + var iconOnly by remember(stopLabel, androidx.compose.ui.platform.LocalConfiguration.current.screenWidthDp) { mutableStateOf(false) } Row( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp), modifier = modifier.heightIn(min = 44.dp).semantics { contentDescription = stopDescription }.testTag("drawer-stop") @@ -865,7 +867,10 @@ private fun StopSessionButton(modifier: Modifier = Modifier, onClick: () -> Unit .padding(start = 12.dp, end = 14.dp), ) { Icon(Icons.Outlined.PowerSettingsNew, contentDescription = null, tint = colors.error, modifier = Modifier.size(18.dp)) - Text(stringResource(R.string.drawer_stop), fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = colors.error) + if (!iconOnly) Text( + stopLabel, fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = colors.error, + maxLines = 1, softWrap = false, onTextLayout = { if (it.hasVisualOverflow) iconOnly = true }, + ) } } @@ -1780,7 +1785,7 @@ private fun StopConfirm( .padding(start = 12.dp, end = 14.dp), ) { Icon(Icons.Outlined.PowerSettingsNew, contentDescription = null, tint = colors.error, modifier = Modifier.size(18.dp)) - Text(stringResource(R.string.drawer_stop), fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = colors.error) + Text(stringResource(R.string.drawer_stop), fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = colors.error, maxLines = 1, softWrap = false) } val maxW = with(density) { StepBoxMaxWidth.toPx() }.coerceAtMost(p.right) Column(