Replace Back inversion toggle with order menu

This commit is contained in:
xXJsonDeruloXx committed 2026-09-23 23:05:12 -04:00
1 parent e40b5ced7d
commit 06d9b7b1cc
4 files changed
+25 -15

No files matched your search

@@ -13,6 +13,12 @@ object SessionPrefs {
const val OSC_STEAM_QAM = "steam-qam"
const val OSC_NEVER = "never"
const val BACK_MENU_THEN_QAM = "1: menu 2: QAM"
const val BACK_QAM_THEN_MENU = "1: QAM 2: menu"
fun backActionsOrder(inverted: Boolean): String =
if (inverted) BACK_QAM_THEN_MENU else BACK_MENU_THEN_QAM
private fun prefs(context: Context) = context.getSharedPreferences("session", Context.MODE_PRIVATE)
fun hudEnabled(context: Context): Boolean = prefs(context).getBoolean("hud", true)
@@ -108,6 +108,7 @@ import coil.compose.AsyncImage
import com.steamdeck.launcher.R
import com.steamdeck.launcher.frontend.Library
import com.steamdeck.launcher.gpu.FrameGen
import com.steamdeck.launcher.session.SessionPrefs
import java.io.File
import kotlin.math.roundToInt
@@ -694,11 +695,12 @@ private fun SetupPanel(s: FrontEndState, a: FrontEndActions) {
ActionRow("ROMs folder", s.romsDir ?: "Choose where emulator games are stored", "Choose", a.onRoms)
}
SettingsGroup("Session") {
ToggleRow(
host, "back-actions", "Invert Back actions",
if (s.backActionsInverted) "Back once opens Steam QAM; twice opens the in-session menu."
else "Back once opens the in-session menu; twice opens Steam QAM.",
s.backActionsInverted, onChange = a.onBackActionsInverted,
ChoiceRow(
host, "back-actions", "Back", SessionPrefs.backActionsOrder(s.backActionsInverted),
listOf(
false to SessionPrefs.BACK_MENU_THEN_QAM,
true to SessionPrefs.BACK_QAM_THEN_MENU,
), s.backActionsInverted, onPick = a.onBackActionsInverted,
)
SettingsRow("Frame generation", "Select the frame generation mode") {
Box {
@@ -229,11 +229,12 @@ fun ModeSettingsPage(s: ModeSettings, a: ModeSettingsActions) {
), s.oscMode,
note = "Auto shows all controls without a controller. Steam + QAM shows only those buttons.", onPick = a.onOsc,
)
if (steam) ToggleRow(
host, "back-actions", "Invert Back actions",
if (s.backActionsInverted) "Back once opens Steam QAM; twice opens the session menu."
else "Back once opens the session menu; twice opens Steam QAM.",
s.backActionsInverted, onChange = a.onBackActionsInverted,
if (steam) ChoiceRow(
host, "back-actions", "Back", SessionPrefs.backActionsOrder(s.backActionsInverted),
listOf(
false to SessionPrefs.BACK_MENU_THEN_QAM,
true to SessionPrefs.BACK_QAM_THEN_MENU,
), s.backActionsInverted, onPick = a.onBackActionsInverted,
)
}
SettingsGroup("Session") {
@@ -298,11 +298,12 @@ fun SessionDrawer(open: Boolean, a: DrawerActions) {
listOf(SessionPrefs.OSC_AUTO to "Auto", SessionPrefs.OSC_ALWAYS to "Always", SessionPrefs.OSC_STEAM_QAM to "Steam + QAM", SessionPrefs.OSC_NEVER to "Never"), a.oscMode,
onPick = a.onOsc,
)
if (a.steam) ToggleRow(
host, "back-actions", "Invert Back actions",
if (a.backActionsInverted) "Back once opens Steam QAM; twice opens the session menu."
else "Back once opens the session menu; twice opens Steam QAM.",
a.backActionsInverted, onChange = a.onBackActionsInverted,
if (a.steam) ChoiceRow(
host, "back-actions", "Back", SessionPrefs.backActionsOrder(a.backActionsInverted),
listOf(
false to SessionPrefs.BACK_MENU_THEN_QAM,
true to SessionPrefs.BACK_QAM_THEN_MENU,
), a.backActionsInverted, onPick = a.onBackActionsInverted,
)
ActionRow("Keyboard", null, "Show") { host.open = null; a.onKeyboard() }
}