From 36916f6bde6ead5ab510c705a5a86ceefbc23925 Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Sun, 27 Sep 2026 14:19:32 -0400 Subject: [PATCH] fix(ui): show launch and tab hints where a pad does that --- .../java/com/droiddeck/launcher/ui/FrontEndRail.kt | 14 +++++++++++--- .../com/droiddeck/launcher/ui/FrontEndScreen.kt | 11 +++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndRail.kt b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndRail.kt index 64ca8571f..ab681e3a6 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndRail.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndRail.kt @@ -53,6 +53,8 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.layout.widthIn import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue @@ -78,7 +80,7 @@ import com.droiddeck.launcher.core.PhantomProcessLimit /** What the pad's face buttons do here, along the bottom edge as on a console. */ @Composable -internal fun ControllerHints() { +internal fun ControllerHints(select: String = "Select", tabs: Boolean = false) { val colors = MaterialTheme.colorScheme val pal = LocalPalette.current Column(modifier = Modifier.fillMaxWidth()) { @@ -88,7 +90,8 @@ internal fun ControllerHints() { horizontalArrangement = Arrangement.spacedBy(18.dp, Alignment.End), modifier = Modifier.fillMaxWidth().height(34.dp).background(colors.surface).padding(horizontal = 20.dp), ) { - HintGlyph("A", "Select") + if (tabs) HintGlyph("LB RB", "Tabs") + HintGlyph("A", select) HintGlyph("B", "Back") } } @@ -98,7 +101,12 @@ internal fun ControllerHints() { private fun HintGlyph(button: String, action: String) { val colors = MaterialTheme.colorScheme Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) { - Box(contentAlignment = Alignment.Center, modifier = Modifier.size(20.dp).clip(CircleShape).background(colors.onBackground)) { + // Face buttons are round; bumpers are a wider keycap. + val shape = if (button.length == 1) CircleShape else RoundedCornerShape(6.dp) + Box( + contentAlignment = Alignment.Center, + modifier = Modifier.height(20.dp).widthIn(min = 20.dp).clip(shape).background(colors.onBackground).padding(horizontal = if (button.length == 1) 0.dp else 6.dp), + ) { Text(button, fontSize = 12.sp, fontWeight = FontWeight.Bold, color = colors.background) } Text(action, fontSize = 13.sp, color = colors.onSurfaceVariant) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndScreen.kt b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndScreen.kt index bc3438d75..b8b842b76 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndScreen.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndScreen.kt @@ -229,7 +229,8 @@ internal class FrontFocus { // and the last one focused. val items = HashMap() val attached = HashMap() - var last: String? = null + // State, so the controller hints follow it: A launches from a game row but selects elsewhere. + var last by mutableStateOf(null) // The first tile of the page's grid: Down from the page's buttons goes to it, not to whichever // tile happens to sit under the button. val firstTile = FocusRequester() @@ -417,7 +418,13 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com AnimatedVisibility( inputModeManager.inputMode == InputMode.Keyboard, enter = expandVertically() + fadeIn(), exit = shrinkVertically() + fadeOut(), - ) { ControllerHints() } + ) { + val onGame = frontFocus.focusedRail == null && frontFocus.last?.startsWith("game:") == true + ControllerHints( + select = if (onGame) "Launch" else "Select", + tabs = railSelection == "setup" && s.pageKey == null && frontFocus.focusedRail == null, + ) + } } }