mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-11 02:51:10 +00:00
fix: restore single-screen session menu controls (#2110)
This commit is contained in:
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,
|
||||
qamInteraction: MutableInteractionSource? = null,
|
||||
onQamConfirm: (() -> Unit)? = null,
|
||||
showShortcuts: Boolean = false,
|
||||
) {
|
||||
onMenu?.let {
|
||||
BarButton(stringResource(R.string.touch_droiddeck_menu), menuModifier.testTag("bottom-bar-menu"), icon = R.drawable.ic_stat_session,
|
||||
active = menuActive, onClick = it)
|
||||
}
|
||||
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 {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
if (a.pipSupported) SteamActionPill(
|
||||
stringResource(R.string.pip_title), Icons.Outlined.PictureInPictureAlt, focus.track(page, "pip"),
|
||||
) { 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 qamInteraction = remember { MutableInteractionSource() }
|
||||
var qamStartedOnPress by remember { mutableStateOf(false) }
|
||||
@@ -509,7 +509,7 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
}
|
||||
}
|
||||
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,
|
||||
onQam = if (steamActions) ({
|
||||
host.open = null
|
||||
@@ -521,7 +521,9 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
qamModifier = focus.track(page, "qam"),
|
||||
qamInteraction = qamInteraction,
|
||||
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 ->
|
||||
DrawerAchievementsRow(a.achievementsProgress, Modifier.padding(top = if (short) 6.dp else 10.dp).then(focus.track(page, "achievements"))) {
|
||||
|
||||
Reference in new issue
Block a user