diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt index 0044a4a7e1..39a006309b 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt @@ -172,11 +172,11 @@ object SessionPrefs { prefs(context).edit().putString("mirrorHide.app.$game", mode).apply() } - /** Where Steam's Quick Access menu sits on the bottom screen when it is narrower than the panel: -1, 0 or 1. */ - fun quickAccessAlign(context: Context): Int = prefs(context).getInt("bottomQamAlign", 0).coerceIn(-1, 1) + /** How Steam's Quick Access menu sits on the bottom screen: full, left, center or right. */ + fun quickAccessLayout(context: Context): String? = prefs(context).getString("bottomQamLayout", null) - fun setQuickAccessAlign(context: Context, align: Int) { - prefs(context).edit().putInt("bottomQamAlign", align.coerceIn(-1, 1)).apply() + fun setQuickAccessLayout(context: Context, id: String) { + prefs(context).edit().putString("bottomQamLayout", id).apply() } fun clearGameBottomScreen(context: Context, game: String) { diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BottomSteamQamPanel.kt b/app/src/main/java/com/droiddeck/launcher/ui/BottomSteamQamPanel.kt index e4578d17bd..43bdc1858d 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/BottomSteamQamPanel.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/BottomSteamQamPanel.kt @@ -1,35 +1,28 @@ package com.droiddeck.launcher.ui +import android.content.Context import android.graphics.BitmapFactory import android.util.Base64 +import androidx.annotation.StringRes import androidx.compose.foundation.Canvas -import androidx.compose.foundation.LocalIndication import androidx.compose.foundation.background -import androidx.compose.foundation.clickable -import androidx.compose.foundation.hoverable -import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.size -import androidx.compose.foundation.layout.width -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.ChevronLeft -import androidx.compose.material.icons.filled.ChevronRight -import androidx.compose.material3.Icon -import androidx.compose.material3.MaterialTheme +import androidx.compose.material.icons.outlined.AlignHorizontalCenter +import androidx.compose.material.icons.outlined.AlignHorizontalLeft +import androidx.compose.material.icons.outlined.AlignHorizontalRight +import androidx.compose.material.icons.outlined.WidthFull import androidx.compose.runtime.Composable import androidx.compose.runtime.DisposableEffect import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue -import androidx.compose.ui.Alignment +import androidx.compose.runtime.snapshotFlow import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.FilterQuality import androidx.compose.ui.graphics.ImageBitmap @@ -41,14 +34,9 @@ import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalDensity -import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource -import androidx.compose.ui.semantics.Role -import androidx.compose.ui.semantics.contentDescription -import androidx.compose.ui.semantics.semantics import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.IntSize -import androidx.compose.ui.unit.dp import com.droiddeck.launcher.R import com.droiddeck.launcher.companion.CdpPage import com.droiddeck.launcher.session.SessionPhase @@ -60,8 +48,10 @@ import kotlin.math.min import kotlin.math.roundToInt import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay +import kotlinx.coroutines.flow.first import kotlinx.coroutines.isActive import kotlinx.coroutines.withContext +import kotlinx.coroutines.withTimeoutOrNull import org.json.JSONArray import org.json.JSONObject @@ -75,6 +65,29 @@ internal class QamFrame(val image: ImageBitmap, val cssWidth: Float, val cssHeig }.getOrDefault(Color.Black) } +/** How Steam's Quick Access menu sits on the bottom screen. */ +internal enum class QamFit(val id: String, @StringRes val label: Int, val icon: ImageVector, val align: Int) { + FULL("full", R.string.bottom_qam_layout_full, Icons.Outlined.WidthFull, 0), + LEFT("left", R.string.bottom_qam_layout_left, Icons.Outlined.AlignHorizontalLeft, -1), + CENTER("center", R.string.bottom_qam_layout_center, Icons.Outlined.AlignHorizontalCenter, 0), + RIGHT("right", R.string.bottom_qam_layout_right, Icons.Outlined.AlignHorizontalRight, 1); + + val next: QamFit get() = entries[(ordinal + 1) % entries.size] + + companion object { + fun from(id: String?): QamFit = entries.firstOrNull { it.id == id } ?: FULL + + private val state = mutableStateOf(null) + + fun current(context: Context): QamFit = state.value ?: from(SessionPrefs.quickAccessLayout(context)).also { state.value = it } + + fun choose(context: Context, fit: QamFit) { + state.value = fit + SessionPrefs.setQuickAccessLayout(context, fit.id) + } + } +} + internal object QamLayout { private const val WIDE_CSS = "div.BasicUI { width: 100% !important; } div[class*=\\\"tab_\\\"] { max-width: none !important; }" @@ -118,7 +131,7 @@ internal fun SteamQamPanel() { delay(2_500) slow = true } - var align by remember { mutableIntStateOf(SessionPrefs.quickAccessAlign(context)) } + val fit = QamFit.current(context) val holder = remember { arrayOfNulls(1) } val relay = remember { intArrayOf(0) } val live = remember { java.util.concurrent.atomic.AtomicBoolean(false) } @@ -177,7 +190,8 @@ internal fun SteamQamPanel() { page?.call("Page.captureScreenshot", JSONObject().put("format", "jpeg").put("quality", 85)) ?.optJSONObject("result")?.optString("data")?.let(::decodeFrame)?.let(show) } - (page?.evaluate(QamLayout.contentScript(wide = !held.top)) as? String)?.let { text -> + val wide = !held.top && QamFit.current(context) == QamFit.FULL + (page?.evaluate(QamLayout.contentScript(wide)) as? String)?.let { text -> runCatching { val a = JSONArray(text) val layout = floatArrayOf(a.getDouble(0).toFloat(), a.getDouble(1).toFloat(), a.getDouble(2).toFloat(), a.getDouble(3).toFloat()) @@ -185,7 +199,10 @@ internal fun SteamQamPanel() { } } } - delay(if (live.get()) TICK_MS else FAST_TICK_MS) + val used = QamFit.current(context) + withTimeoutOrNull(if (live.get()) TICK_MS else FAST_TICK_MS) { + snapshotFlow { QamFit.current(context) }.first { it != used } + } } } } @@ -204,9 +221,9 @@ internal fun SteamQamPanel() { val density = LocalDensity.current val boxW = with(density) { maxWidth.toPx() } val boxH = with(density) { maxHeight.toPx() } - val (scale, left) = QamLayout.fit(boxW, boxH, f.contentRight, f.cssHeight, align) + val (scale, left) = QamLayout.fit(boxW, boxH, f.contentRight, f.cssHeight, fit.align) Canvas( - Modifier.fillMaxSize().pointerInput(f.cssWidth, f.contentRight, boxW, boxH, align) { + Modifier.fillMaxSize().pointerInput(f.cssWidth, f.contentRight, boxW, boxH, fit) { var touching = false awaitPointerEventScope { while (true) { @@ -238,38 +255,6 @@ internal fun SteamQamPanel() { filterQuality = FilterQuality.Medium, ) } - val width = f.contentRight * scale - val gap = with(density) { 64.dp.toPx() } - val move = { step: Int -> align = (align + step).coerceIn(-1, 1); SessionPrefs.setQuickAccessAlign(context, align) } - if (left >= gap) { - Box(Modifier.align(Alignment.CenterStart).width(with(density) { left.toDp() }), contentAlignment = Alignment.Center) { - MoveHandle(stringResource(R.string.bottom_qam_align_left), Icons.Filled.ChevronLeft, Modifier.testTag("qam-move-left")) { move(-1) } - } - } - if (boxW - left - width >= gap) { - Box(Modifier.align(Alignment.CenterEnd).width(with(density) { (boxW - left - width).toDp() }), contentAlignment = Alignment.Center) { - MoveHandle(stringResource(R.string.bottom_qam_align_right), Icons.Filled.ChevronRight, Modifier.testTag("qam-move-right")) { move(1) } - } - } - } -} - -@Composable -private fun MoveHandle(description: String, icon: ImageVector, modifier: Modifier, onClick: () -> Unit) { - val colors = MaterialTheme.colorScheme - val pal = LocalPalette.current - val src = remember { MutableInteractionSource() } - val hot = rememberHot(src) - val shape = RoundedCornerShape(22.dp) - Box( - contentAlignment = Alignment.Center, - modifier = modifier.size(width = 44.dp, height = 112.dp).semantics { contentDescription = description } - .clip(shape) - .background(if (hot) pal.signal.copy(alpha = 0.14f) else Color.White.copy(alpha = 0.04f)) - .glideBorder(hot, shape, pal.signal) - .hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, role = Role.Button, onClick = onClick), - ) { - Icon(icon, contentDescription = null, tint = if (hot) pal.signal else colors.onSurfaceVariant, modifier = Modifier.size(28.dp)) } } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SecondScreenPresentation.kt b/app/src/main/java/com/droiddeck/launcher/ui/SecondScreenPresentation.kt index dfab5e7f07..a73a901029 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SecondScreenPresentation.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SecondScreenPresentation.kt @@ -367,8 +367,13 @@ class SecondScreenPresentation( context.getString(if (keyboardShown.value) R.string.second_hide_keyboard else R.string.second_show_keyboard), icon = R.drawable.ic_bottom_keyboard, active = keyboardShown.value, tag = "bottom-keyboard") { showKeyboard() }) + extras) SecondScreenMode.DECK_CONTROLS -> model(extras, deckPanelTabs(context, deckPanel.value, ::selectDeckPanel)) + SecondScreenMode.STEAM_QAM -> { + val fit = QamFit.current(context) + model(listOf(BarExtra(context.getString(R.string.bottom_qam_layout, context.getString(fit.label)), vector = fit.icon, + tag = "bottom-qam-layout") { QamFit.choose(context, fit.next) }) + extras) + } SecondScreenMode.DASHBOARD, SecondScreenMode.CUSTOM_CONTROLS, SecondScreenMode.GUIDES, SecondScreenMode.MIRROR, - SecondScreenMode.COMPANION, SecondScreenMode.STEAM_QAM -> model(extras) + SecondScreenMode.COMPANION -> model(extras) SecondScreenMode.TERMINAL -> model(listOf(BarExtra(context.getString(R.string.drawer_keyboard), icon = R.drawable.ic_bottom_keyboard, tag = "bottom-keyboard") { terminalPanel?.showKeyboard() }) + extras) else -> null diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index e5dd113572..f4531778ae 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -2244,8 +2244,11 @@ الحمولة الراديو الوصول السريع - نقل إلى اليسار - نقل إلى اليمين + التخطيط: %1$s + العرض الكامل + يسار + وسط + يمين قائمة الوصول السريع في Steam غير متاحة بعد. إحصاءات داخل اللعبة مؤشرات الشاشة السفلية diff --git a/app/src/main/res/values-b+es+419/strings.xml b/app/src/main/res/values-b+es+419/strings.xml index a677f2d772..913b27337d 100644 --- a/app/src/main/res/values-b+es+419/strings.xml +++ b/app/src/main/res/values-b+es+419/strings.xml @@ -2239,8 +2239,11 @@ Peso cargado Radio Acceso rápido - Mover a la izquierda - Mover a la derecha + Diseño: %1$s + Ancho completo + Izquierda + Centro + Derecha El menú de acceso rápido de Steam aún no está disponible. Estadísticas del juego HUD de la pantalla inferior diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index 1bc0aa958e..36fab1743d 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -2144,8 +2144,11 @@ Товар Радио Бърз достъп - Премести вляво - Премести вдясно + Оформление: %1$s + Цяла ширина + Вляво + В центъра + Вдясно Менюто за бърз достъп на Steam още не е налично. Статистика в играта HUD на долния екран diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 7cbb0983e6..9755ff9109 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -2194,8 +2194,11 @@ Nosnost Rádio Rychlý přístup - Přesunout doleva - Přesunout doprava + Rozložení: %1$s + Plná šířka + Vlevo + Na střed + Vpravo Nabídka rychlého přístupu Steamu zatím není k dispozici. Statistiky ve hře HUD na spodní obrazovce diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index b8e3e9feff..33dd1148a3 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -2144,8 +2144,11 @@ Bæreevne Radio Hurtig adgang - Flyt til venstre - Flyt til højre + Layout: %1$s + Fuld bredde + Venstre + Midte + Højre Steams menu til hurtig adgang er ikke tilgængelig endnu. Statistik i spillet HUD på nederste skærm diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index c7fcd11506..fe432f3e78 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -2136,8 +2136,11 @@ Traglast Radio Schnellzugriff - Nach links verschieben - Nach rechts verschieben + Layout: %1$s + Volle Breite + Links + Mitte + Rechts Das Schnellzugriffsmenü von Steam ist noch nicht verfügbar. Spielstatistiken HUD für den unteren Bildschirm diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 5f22716fef..a8ea075987 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -2144,8 +2144,11 @@ Φορτίο Ραδιόφωνο Γρήγορη πρόσβαση - Μετακίνηση αριστερά - Μετακίνηση δεξιά + Διάταξη: %1$s + Πλήρες πλάτος + Αριστερά + Κέντρο + Δεξιά Το μενού γρήγορης πρόσβασης του Steam δεν είναι ακόμη διαθέσιμο. Στατιστικά παιχνιδιού HUD κάτω οθόνης diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index adaa5ff369..8faba99151 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -2169,8 +2169,11 @@ Peso cargado Radio Acceso rápido - Mover a la izquierda - Mover a la derecha + Diseño: %1$s + Ancho completo + Izquierda + Centro + Derecha El menú de acceso rápido de Steam aún no está disponible. Estadísticas del juego HUD de la pantalla inferior diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index b85e88ebeb..302a42fc91 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -2144,8 +2144,11 @@ Kantokyky Radio Pikavalikko - Siirrä vasemmalle - Siirrä oikealle + Asettelu: %1$s + Koko leveys + Vasen + Keskellä + Oikea Steamin pikavalikko ei ole vielä käytettävissä. Pelinsisäiset tilastot Alanäytön HUD diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 5900687971..5bd2a84d58 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -2168,8 +2168,11 @@ Charge Radio Accès rapide - Déplacer à gauche - Déplacer à droite + Disposition : %1$s + Pleine largeur + Gauche + Centre + Droite Le menu d’accès rapide de Steam n’est pas encore disponible. Statistiques en jeu HUD de l\'écran du bas diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index c7ba370be9..fc8848e892 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -2144,8 +2144,11 @@ वज़न क्षमता रेडियो क्विक एक्सेस - बाईं ओर ले जाएँ - दाईं ओर ले जाएँ + लेआउट: %1$s + पूरी चौड़ाई + बाएँ + बीच में + दाएँ Steam का क्विक एक्सेस मेनू अभी उपलब्ध नहीं है। इन-गेम आंकड़े निचली स्क्रीन HUD diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 4ce071728e..127346f321 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -2144,8 +2144,11 @@ Teherbírás Rádió Gyorselérés - Áthelyezés balra - Áthelyezés jobbra + Elrendezés: %1$s + Teljes szélesség + Balra + Középen + Jobbra A Steam gyorselérési menüje még nem érhető el. Játékon belüli statisztikák HUD az alsó képernyőn diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 1f925b63dc..1f067e981a 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -2120,8 +2120,11 @@ Beban Radio Akses Cepat - Pindahkan ke kiri - Pindahkan ke kanan + Tata letak: %1$s + Lebar penuh + Kiri + Tengah + Kanan Menu Akses Cepat Steam belum tersedia. Statistik dalam gim HUD layar bawah diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 7d5e02842c..cb43c8e75b 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -2160,8 +2160,11 @@ Peso trasportato Radio Accesso rapido - Sposta a sinistra - Sposta a destra + Layout: %1$s + Larghezza piena + Sinistra + Centro + Destra Il menu di accesso rapido di Steam non è ancora disponibile. Statistiche di gioco HUD dello schermo inferiore diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index adcb918c9f..2950988316 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -2120,8 +2120,11 @@ 所持重量 ラジオ クイックアクセス - 左へ移動 - 右へ移動 + レイアウト: %1$s + 全幅 + 左 + 中央 + 右 Steam のクイックアクセスメニューはまだ使えません。 ゲーム内統計 下部画面の HUD diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index d7ec245e9f..52bc077459 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -2120,8 +2120,11 @@ 소지 무게 라디오 빠른 메뉴 - 왼쪽으로 이동 - 오른쪽으로 이동 + 레이아웃: %1$s + 전체 너비 + 왼쪽 + 가운데 + 오른쪽 Steam 빠른 메뉴를 아직 사용할 수 없습니다. 게임 내 통계 하단 화면 HUD diff --git a/app/src/main/res/values-ms/strings.xml b/app/src/main/res/values-ms/strings.xml index a49778b5f8..cb4452336a 100644 --- a/app/src/main/res/values-ms/strings.xml +++ b/app/src/main/res/values-ms/strings.xml @@ -2120,8 +2120,11 @@ Beban Radio Akses Pantas - Alih ke kiri - Alih ke kanan + Susun atur: %1$s + Lebar penuh + Kiri + Tengah + Kanan Menu Akses Pantas Steam belum tersedia. Statistik dalam permainan HUD skrin bawah diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index 0505e0d2ad..b4c1160320 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -2144,8 +2144,11 @@ Bæreevne Radio Hurtigtilgang - Flytt til venstre - Flytt til høyre + Oppsett: %1$s + Full bredde + Venstre + Midten + Høyre Steams hurtigtilgangsmeny er ikke tilgjengelig ennå. Statistikk i spillet HUD på bunnskjermen diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 44d5c041a6..921be08eee 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -2144,8 +2144,11 @@ Draaggewicht Radio Snelle toegang - Naar links verplaatsen - Naar rechts verplaatsen + Indeling: %1$s + Volledige breedte + Links + Midden + Rechts Het menu Snelle toegang van Steam is nog niet beschikbaar. In-game statistieken HUD op het onderste scherm diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index e42b43ec72..af35980cd7 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -2194,8 +2194,11 @@ Udźwig Radio Szybki dostęp - Przesuń w lewo - Przesuń w prawo + Układ: %1$s + Pełna szerokość + Do lewej + Na środku + Do prawej Menu szybkiego dostępu Steam nie jest jeszcze dostępne. Statystyki w grze HUD dolnego ekranu diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index 05f0736ef9..28ed7188c3 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -2174,8 +2174,11 @@ Peso transportado Rádio Acesso rápido - Mover para a esquerda - Mover para a direita + Esquema: %1$s + Largura total + Esquerda + Centro + Direita O menu de acesso rápido do Steam ainda não está disponível. Estatísticas no jogo HUD do ecrã inferior diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 9808691c9d..e0c7ebb3d9 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -2182,8 +2182,11 @@ Peso carregado Rádio Acesso rápido - Mover para a esquerda - Mover para a direita + Layout: %1$s + Largura total + Esquerda + Centro + Direita O menu de acesso rápido do Steam ainda não está disponível. Estatísticas no jogo HUD da tela inferior diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 145fcb77c5..8a35825747 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -2169,8 +2169,11 @@ Greutate purtată Radio Acces rapid - Mută la stânga - Mută la dreapta + Aspect: %1$s + Lățime completă + Stânga + Centru + Dreapta Meniul de acces rapid Steam nu este încă disponibil. Statistici în joc HUD pe ecranul de jos diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 1da08a7159..d95412bb8c 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -2195,8 +2195,11 @@ Переносимый вес Радио Быстрый доступ - Сдвинуть влево - Сдвинуть вправо + Макет: %1$s + Во всю ширину + Слева + По центру + Справа Меню быстрого доступа Steam пока недоступно. Игровая статистика HUD нижнего экрана diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 1231afa030..9ad293110f 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -2144,8 +2144,11 @@ Bärvikt Radio Snabbåtkomst - Flytta till vänster - Flytta till höger + Layout: %1$s + Full bredd + Vänster + Mitten + Höger Steams snabbåtkomstmeny är inte tillgänglig än. Statistik i spelet HUD på nedre skärmen diff --git a/app/src/main/res/values-th/strings.xml b/app/src/main/res/values-th/strings.xml index 58e49aeac9..37a9de51fd 100644 --- a/app/src/main/res/values-th/strings.xml +++ b/app/src/main/res/values-th/strings.xml @@ -2120,8 +2120,11 @@ น้ำหนักที่แบก วิทยุ เข้าถึงด่วน - ย้ายไปทางซ้าย - ย้ายไปทางขวา + เลย์เอาต์: %1$s + เต็มความกว้าง + ซ้าย + กึ่งกลาง + ขวา เมนูเข้าถึงด่วนของ Steam ยังไม่พร้อมใช้งาน สถิติในเกม HUD หน้าจอล่าง diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 665e932d9b..aeb1e6eb8b 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -2136,8 +2136,11 @@ Taşıma ağırlığı Radyo Hızlı Erişim - Sola taşı - Sağa taşı + Düzen: %1$s + Tam genişlik + Sol + Orta + Sağ Steam Hızlı Erişim menüsü henüz kullanılamıyor. Oyun içi istatistikler Alt ekrandaki HUD diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 0dd0a2642c..cf072fb9bf 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -2194,8 +2194,11 @@ Вага ноші Радіо Швидкий доступ - Перемістити ліворуч - Перемістити праворуч + Макет: %1$s + На всю ширину + Ліворуч + По центру + Праворуч Меню швидкого доступу Steam ще недоступне. Ігрова статистика HUD на нижньому екрані diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index 1557a86afa..2788d697f1 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -2120,8 +2120,11 @@ Trọng lượng mang Radio Truy cập nhanh - Chuyển sang trái - Chuyển sang phải + Bố cục: %1$s + Toàn chiều rộng + Trái + Giữa + Phải Menu Truy cập nhanh của Steam chưa sẵn sàng. Thông số trong game HUD màn hình dưới diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 37b46caf0b..c323fad178 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -2197,8 +2197,11 @@ 负重 收音机 快速访问 - 移到左侧 - 移到右侧 + 布局:%1$s + 全宽 + 左侧 + 居中 + 右侧 Steam 快速访问菜单暂不可用。 游戏内数据 下屏 HUD diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 6d7d638d2d..0c8b88f880 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -2119,8 +2119,11 @@ 負重 收音機 快速存取 - 移到左側 - 移到右側 + 版面配置:%1$s + 全寬 + 左側 + 置中 + 右側 Steam 快速存取選單暫時無法使用。 遊戲內數據 下方螢幕 HUD diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index c785161bea..beb1975140 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -2119,8 +2119,11 @@ 負重 收音機 快速存取 - 移到左側 - 移到右側 + 版面配置:%1$s + 全寬 + 左側 + 置中 + 右側 Steam 快速存取選單暫時無法使用。 遊戲內數據 下螢幕 HUD diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ebad19d44b..63a55b55f3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2427,8 +2427,11 @@ Carry weight Radio Quick Access - Move to the left - Move to the right + Layout: %1$s + Full width + Left + Center + Right Steam\'s Quick Access menu is not available yet. In-game stats Bottom screen HUD diff --git a/app/src/test/java/com/droiddeck/launcher/session/SteamQamTest.kt b/app/src/test/java/com/droiddeck/launcher/session/SteamQamTest.kt index 59a6be351c..0952c894e3 100644 --- a/app/src/test/java/com/droiddeck/launcher/session/SteamQamTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/session/SteamQamTest.kt @@ -1,5 +1,6 @@ package com.droiddeck.launcher.session +import com.droiddeck.launcher.ui.QamFit import com.droiddeck.launcher.ui.QamLayout import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse @@ -82,6 +83,13 @@ class SteamQamTest { assertEquals(0f, QamLayout.fit(1280f, 832f, 1280f, 640f, 1).second, 0.001f) } + @Test fun theLayoutButtonCyclesFullLeftCenterRight() { + assertEquals(listOf(QamFit.LEFT, QamFit.CENTER, QamFit.RIGHT, QamFit.FULL), QamFit.entries.map { it.next }) + assertEquals(QamFit.FULL, QamFit.from(null)) + assertEquals(QamFit.RIGHT, QamFit.from("right")) + assertEquals(QamFit.FULL, QamFit.from("sideways")) + } + @Test fun aWideMenuFitsTheWidth() { val (scale, left) = QamLayout.fit(1280f, 832f, 1280f, 640f) assertEquals(1f, scale, 0.001f) diff --git a/docs/development/bottom-screen.md b/docs/development/bottom-screen.md index 62ec76215b..984c7f9797 100644 --- a/docs/development/bottom-screen.md +++ b/docs/development/bottom-screen.md @@ -170,10 +170,10 @@ Details: [bottom-screen-companion-api.md](bottom-screen-companion-api.md). Plugin loaders expose Steam's CEF DevTools so the menu can be viewed in a desktop browser, but it renders only while it is open on the main screen. The panel keeps it open without covering the top screen: - Steam's UI is told to open the menu and keep it open: its composition request is capped at "notification" while the menu is ours, so gamescope keeps focus on the game, and losing focus no longer closes it. Gamepad focus moves from the menu back to the main UI only when the menu took it, so Steam's own popups keep the controller. The blurred backdrop is hidden. -- The menu's browser view is placed just outside the Big Picture window through its own `SetBounds`, so it keeps rendering but never shows on top, including while Steam slides it wider for Friends and chat. The view is also given the panel's shape (about 712 × 463 instead of Steam's 856 × 463), and a style on the menu page lifts Steam's 300 px cap on each tab, so every tab fills the panel at one scale, with Friends showing its list and chat side by side. +- The menu's browser view is placed just outside the Big Picture window through its own `SetBounds`, so it keeps rendering but never shows on top, including while Steam slides it wider for Friends and chat. The view is also given the panel's shape (about 712 × 463 instead of Steam's 856 × 463), so every tab shows at one scale. In Full width, a style on the menu page also lifts Steam's 300 px cap on each tab, so every tab fills the panel and Friends shows its list and chat side by side. - A timer inside Steam keeps this state every 250 ms, so the menu comes back, on the tab it was showing, as soon as Steam's main menu or a full-screen page such as Decky's store closes. It runs on a 5 s lease that the panel renews each second: if the app stops, Steam returns to normal by itself. - The hold starts only once the session is ready: holding the menu before Steam's first frame kept gamescope from presenting anything. -- `droiddeck-qam-relay` relays the app to the DevTools port, which only answers clients inside the guest. The panel streams the menu with `Page.startScreencast`, scales its content to the panel and fills the rest with the menu's own background, and forwards touches on the menu with `Input.dispatchTouchEvent`. If a Steam update brings back a narrow tab, a chevron in the free space on each side steps it left, centre or right; the choice is kept. Returning to the panel shows the last frame at once while the stream reconnects, and the first frame after a cold start takes about 1.4 s. +- `droiddeck-qam-relay` relays the app to the DevTools port, which only answers clients inside the guest. The panel streams the menu with `Page.startScreencast`, scales its content to the panel and fills the rest with the menu's own background, and forwards touches on the menu with `Input.dispatchTouchEvent`. A layout button in the panel's bar cycles Full width (every tab stretched to the panel), Left, Center and Right (Steam's own narrow tabs, placed on that side); the choice is kept. Returning to the panel shows the last frame at once while the stream reconnects, and the first frame after a cold start takes about 1.4 s. - The Quick Access button still shows the menu on the top screen, in Steam's own layout and with the controller; closing it there (B or the button again) returns it to the bottom screen on the same tab. - Leaving the panel closes the menu and turns the patches off; the Steam button and the normal Quick Access button then work as before. Opening Steam's main menu replaces the Quick Access menu for as long as it is open, as on a Deck. @@ -189,6 +189,10 @@ Limits: it relies on Steam's minified UI stores and method names, so a client up | --- | --- | | ![](evidence/bottom-screen-qam-decky-2026-11-27.png) | ![](evidence/bottom-screen-qam-performance-2026-11-27.png) | +| Layout: Center | Layout: Right | +| --- | --- | +| ![](evidence/bottom-screen-qam-center-2026-11-27.png) | ![](evidence/bottom-screen-qam-right-2026-11-27.png) | + The top screen during that game, with the menu open on the bottom: ![](evidence/bottom-screen-qam-top-ingame-2026-11-27.png) ## Related fixes diff --git a/docs/development/evidence/bottom-screen-qam-center-2026-11-27.png b/docs/development/evidence/bottom-screen-qam-center-2026-11-27.png new file mode 100644 index 0000000000..f511b716ac Binary files /dev/null and b/docs/development/evidence/bottom-screen-qam-center-2026-11-27.png differ diff --git a/docs/development/evidence/bottom-screen-qam-right-2026-11-27.png b/docs/development/evidence/bottom-screen-qam-right-2026-11-27.png new file mode 100644 index 0000000000..858308fc97 Binary files /dev/null and b/docs/development/evidence/bottom-screen-qam-right-2026-11-27.png differ diff --git a/docs/development/evidence/bottom-screen-qam-settings-2026-11-27.png b/docs/development/evidence/bottom-screen-qam-settings-2026-11-27.png index 5a95449e25..31f298e77a 100644 Binary files a/docs/development/evidence/bottom-screen-qam-settings-2026-11-27.png and b/docs/development/evidence/bottom-screen-qam-settings-2026-11-27.png differ