fix: restore single-screen session menu controls (#2110)

This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-11-04 22:15:03 -05:00
1 parent 516e3862fa
commit a9d2d09e64
2 files changed
+8 -3

No files matched your search

@@ -112,16 +112,19 @@ internal fun BarActions(
qamModifier: Modifier = Modifier, qamModifier: Modifier = Modifier,
qamInteraction: MutableInteractionSource? = null, qamInteraction: MutableInteractionSource? = null,
onQamConfirm: (() -> Unit)? = null, onQamConfirm: (() -> Unit)? = null,
showShortcuts: Boolean = false,
) { ) {
onMenu?.let { onMenu?.let {
BarButton(stringResource(R.string.touch_droiddeck_menu), menuModifier.testTag("bottom-bar-menu"), icon = R.drawable.ic_stat_session, BarButton(stringResource(R.string.touch_droiddeck_menu), menuModifier.testTag("bottom-bar-menu"), icon = R.drawable.ic_stat_session,
active = menuActive, onClick = it) active = menuActive, onClick = it)
} }
onSteam?.let { onSteam?.let {
BarButton(stringResource(R.string.drawer_steam_menu), steamModifier.testTag("bottom-bar-steam"), label = "STEAM", onClick = it) BarButton(stringResource(R.string.drawer_steam_menu), steamModifier.testTag("bottom-bar-steam"), label = "STEAM",
shortcut = if (showShortcuts) "⧉" else null, onClick = it)
} }
onQam?.let { onQam?.let {
BarButton(stringResource(R.string.drawer_open_qam), qamModifier.testTag("bottom-bar-qam"), vector = Icons.Outlined.MoreHoriz, BarButton(stringResource(R.string.drawer_open_qam), qamModifier.testTag("bottom-bar-qam"), vector = Icons.Outlined.MoreHoriz,
shortcut = if (showShortcuts) "☰" else null,
interactionSource = qamInteraction ?: remember { MutableInteractionSource() }, onConfirm = onQamConfirm, onClick = it) interactionSource = qamInteraction ?: remember { MutableInteractionSource() }, onConfirm = onQamConfirm, onClick = it)
} }
} }
@@ -493,7 +493,7 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
if (a.pipSupported) SteamActionPill( if (a.pipSupported) SteamActionPill(
stringResource(R.string.pip_title), Icons.Outlined.PictureInPictureAlt, focus.track(page, "pip"), stringResource(R.string.pip_title), Icons.Outlined.PictureInPictureAlt, focus.track(page, "pip"),
) { host.open = null; a.onPip() } ) { host.open = null; a.onPip() }
StopSessionButton(modifier = focus.track(page, "stop").onGloballyPositioned { stopCoords = it }) { host.open = null; confirmStop = true } if (docked) StopSessionButton(modifier = focus.track(page, "stop").onGloballyPositioned { stopCoords = it }) { host.open = null; confirmStop = true }
val steamActions = a.steam && a.onSteamMenu != null && a.onQam != null val steamActions = a.steam && a.onSteamMenu != null && a.onQam != null
val qamInteraction = remember { MutableInteractionSource() } val qamInteraction = remember { MutableInteractionSource() }
var qamStartedOnPress by remember { mutableStateOf(false) } var qamStartedOnPress by remember { mutableStateOf(false) }
@@ -509,7 +509,7 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
} }
} }
BarActions( BarActions(
onMenu = { host.open = null; a.onClose() }, menuActive = true, onMenu = if (docked) ({ host.open = null; a.onClose() }) else null, menuActive = true,
onSteam = if (steamActions) ({ host.open = null; a.onSteamMenu?.invoke() }) else null, onSteam = if (steamActions) ({ host.open = null; a.onSteamMenu?.invoke() }) else null,
onQam = if (steamActions) ({ onQam = if (steamActions) ({
host.open = null host.open = null
@@ -521,7 +521,9 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
qamModifier = focus.track(page, "qam"), qamModifier = focus.track(page, "qam"),
qamInteraction = qamInteraction, qamInteraction = qamInteraction,
onQamConfirm = { host.open = null; a.onQam?.invoke() }, onQamConfirm = { host.open = null; a.onQam?.invoke() },
showShortcuts = !docked,
) )
if (!docked) StopSessionButton(modifier = focus.track(page, "stop").onGloballyPositioned { stopCoords = it }) { host.open = null; confirmStop = true }
} }
a.onAchievements?.let { show -> a.onAchievements?.let { show ->
DrawerAchievementsRow(a.achievementsProgress, Modifier.padding(top = if (short) 6.dp else 10.dp).then(focus.track(page, "achievements"))) { DrawerAchievementsRow(a.achievementsProgress, Modifier.padding(top = if (short) 6.dp else 10.dp).then(focus.track(page, "achievements"))) {