Android: Exit back in the library menu, Skins next to the control tabs

Exit returns to the library's overflow menu. It had moved to the navigation
drawer, which put it below every other destination -- so quitting, one of the
most frequent things anyone does from that screen, meant opening the drawer and
scrolling to the bottom every time. Reported as issue #460 by shinobumaehara,
whose point is simply that frequency should decide placement. It stays in the
drawer as well; this is the short path, not a replacement.

Smaller than it looked: onExitApp was still a parameter and its confirmation
dialog was still wired up. Only the row that reached them had been deleted.

LibraryOverflowItem gained optional iconRes/iconTint for it, because the power
symbol (U+23FB) is not in the bundled font and rendered as a tofu box -- it now
uses the same ic_power drawable and red as the drawer's row, so the two entries
match. Every other row keeps the text-glyph path untouched.

Skins moves to sit after Shortcuts and before Network. It is controller artwork,
so people look for it beside Controls and Shortcuts rather than past On-Screen.
Suggested by Isshin.
This commit is contained in:
jpolo1224
2026-07-28 12:50:06 -04:00
parent 363009987a
commit d4caacf512
2 changed files with 41 additions and 7 deletions
@@ -831,6 +831,25 @@ private fun LibraryOverflowMenu(
closeThen(onClearBackground)
}
}
OverflowSeparator()
// Exit, back where it used to live. It moved to the drawer, which put it below every other
// destination -- so quitting, one of the most frequent things anyone does here, meant
// opening the drawer and scrolling to the bottom every time (issue #460, and shinobumaehara
// is right that frequency should decide placement). It stays in the drawer too; this is the
// short path, not a replacement.
//
// The confirmation is the point of the row and travels with it: quitting mid-session
// without one loses whatever is not saved.
// onExitApp was still a parameter and its confirmation dialog was still wired up — only
// the row that reached them had been removed. So this restores the item, not the feature.
LibraryOverflowItem(
glyph = "",
label = str("games.toolbar.exit"),
iconRes = com.armsx2.R.drawable.ic_power,
iconTint = Color(0xFFE60012),
) {
closeThen(onExitApp)
}
}
}
@@ -848,6 +867,10 @@ private fun LibraryOverflowItem(
label: String,
selected: Boolean = false,
trailing: String? = null,
// A real drawable instead of a text glyph. Exit needs this: the power symbol (U+23FB) is not
// in the bundled font and rendered as a tofu box. Null keeps the glyph path for every other row.
iconRes: Int? = null,
iconTint: Color? = null,
onClick: () -> Unit,
) {
DropdownMenuItem(
@@ -868,12 +891,21 @@ private fun LibraryOverflowItem(
color = if (selected) MaterialTheme.colorScheme.primaryContainer else MaterialTheme.colorScheme.surfaceVariant,
) {
Box(contentAlignment = Alignment.Center) {
Text(
text = glyph,
fontSize = if (glyph.length > 2) 11.sp else 17.sp,
fontWeight = FontWeight.Bold,
color = if (selected) MaterialTheme.colorScheme.onPrimaryContainer else MaterialTheme.colorScheme.onSurface,
)
if (iconRes != null) {
androidx.compose.material3.Icon(
painter = androidx.compose.ui.res.painterResource(iconRes),
contentDescription = null,
tint = iconTint ?: MaterialTheme.colorScheme.onSurface,
modifier = Modifier.size(19.dp),
)
} else {
Text(
text = glyph,
fontSize = if (glyph.length > 2) 11.sp else 17.sp,
fontWeight = FontWeight.Bold,
color = if (selected) MaterialTheme.colorScheme.onPrimaryContainer else MaterialTheme.colorScheme.onSurface,
)
}
}
}
},
@@ -412,9 +412,11 @@ private fun settingsSections() = listOf(
SettingsSection(SettingsCategory.Audio, "tab.audio", ""),
SettingsSection(SettingsCategory.Controls, "tab.controls", ""),
SettingsSection(SettingsCategory.Hotkeys, "tab.hotkeys", ""),
// Skins sits with the control-related tabs rather than after On-Screen: it is controller
// artwork, so people look for it next to Controls and Shortcuts. Requested by Isshin.
SettingsSection(SettingsCategory.Skins, "tab.skins", ""),
SettingsSection(SettingsCategory.Network, "tab.network", ""),
SettingsSection(SettingsCategory.OnScreen, "tab.overlay", ""),
SettingsSection(SettingsCategory.Skins, "tab.skins", ""),
SettingsSection(SettingsCategory.Advanced, "tab.fixes", ""),
SettingsSection(SettingsCategory.Patches, "tab.patches", ""),
)