mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 21:35:59 +00:00
Keyboard in the drawer, and GE-Proton / proton-cachyos on request
A session had no way to type without a hardware keyboard. The drawer's Keyboard opens the soft keyboard onto an invisible host View whose InputConnection turns what the IME commits into the key events that would have typed it, and the key path carries Bannerlator's two soft-keyboard fixes: a symbol key with no scan code is worked back from the character it stands for, and a capital gets the Shift a soft keyboard reports but never sends — not a hardware one, whose own Shift would be released early by a second. Compatibility tools, on the main screen and in the drawer, queues a GE-Proton or proton-cachyos install as a line in the runtime's ~/.bl-proton-extra, which the session script hands to bannerlator-proton-extra before the client starts; it shows what is installed and removes a build.
This commit is contained in:
1 parent
b74aa97996
commit
af25620316
9 files changed
+388
-6
No files matched your search
@@ -59,6 +59,7 @@ fun MainScreen(
|
||||
onPlay: () -> Unit,
|
||||
onRuntime: () -> Unit,
|
||||
onFrameGen: () -> Unit,
|
||||
onProtons: () -> Unit,
|
||||
onCredits: () -> Unit,
|
||||
) {
|
||||
BoxWithConstraints(
|
||||
@@ -142,6 +143,10 @@ fun MainScreen(
|
||||
onClick = onFrameGen,
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 5.dp * k).height(buttonHeight + 5.dp * k),
|
||||
) { Text("Frame generation: ${state.frameGenLabel}", fontSize = 13.sp * k) }
|
||||
OutlinedButton(
|
||||
onClick = onProtons,
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 5.dp * k).height(buttonHeight + 5.dp * k),
|
||||
) { Text("Compatibility tools", fontSize = 13.sp * k) }
|
||||
Spacer(Modifier.height(10.dp * k))
|
||||
Text(
|
||||
"by The412Banner and maxjivi05 · credits",
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.steamdeck.launcher.ui
|
||||
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
/** One third-party Proton as the dialog shows it. */
|
||||
class ProtonRow(val id: String, val name: String, val installed: String?, val queued: Boolean)
|
||||
|
||||
/**
|
||||
* GE-Proton and proton-cachyos: installed, queued for the next session, or neither. Installing
|
||||
* happens inside the runtime when a session starts (a download of several hundred MB), so the
|
||||
* dialog only ever queues or cancels a request, and removes an installed build.
|
||||
*/
|
||||
@Composable
|
||||
fun ProtonDialog(
|
||||
rows: List<ProtonRow>,
|
||||
onInstall: (String) -> Unit,
|
||||
onCancel: (String) -> Unit,
|
||||
onRemove: (String) -> Unit,
|
||||
onDismiss: () -> Unit,
|
||||
) {
|
||||
AlertDialog(
|
||||
onDismissRequest = onDismiss,
|
||||
title = { Text("Compatibility tools") },
|
||||
text = {
|
||||
Column {
|
||||
Text(
|
||||
"Native ARM64 Proton builds beside the ARM64 Proton Valve ships. Installed when a session starts — a large download — and then chosen per game in Steam under Properties → Compatibility.",
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
Spacer(Modifier.height(10.dp))
|
||||
for (row in rows) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp)) {
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
Text(row.name, style = MaterialTheme.typography.bodyMedium)
|
||||
Text(
|
||||
when {
|
||||
row.installed != null -> "installed: ${row.installed}"
|
||||
row.queued -> "installs at the next session start"
|
||||
else -> "not installed"
|
||||
},
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
}
|
||||
when {
|
||||
row.installed != null -> TextButton(onClick = { onRemove(row.id) }) { Text("Remove") }
|
||||
row.queued -> TextButton(onClick = { onCancel(row.id) }) { Text("Cancel") }
|
||||
else -> TextButton(onClick = { onInstall(row.id) }) { Text("Install") }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
confirmButton = { TextButton(onClick = onDismiss) { Text("OK") } },
|
||||
)
|
||||
}
|
||||
@@ -90,6 +90,8 @@ class DrawerActions(
|
||||
val shapeMode: String,
|
||||
val onHud: (Boolean) -> Unit,
|
||||
val onFrameGen: () -> Unit,
|
||||
val onKeyboard: () -> Unit,
|
||||
val onProtons: () -> Unit,
|
||||
val onOsc: () -> Unit,
|
||||
val onShape: () -> Unit,
|
||||
val onBackground: () -> Unit,
|
||||
@@ -124,9 +126,15 @@ fun SessionDrawer(a: DrawerActions) {
|
||||
Text("Performance HUD", color = Color(0xFFDDDDDD), fontSize = 13.sp, modifier = Modifier.weight(1f))
|
||||
Switch(checked = a.hudOn, onCheckedChange = a.onHud)
|
||||
}
|
||||
OutlinedButton(onClick = a.onFrameGen, modifier = Modifier.fillMaxWidth().padding(top = 8.dp)) {
|
||||
OutlinedButton(onClick = a.onKeyboard, modifier = Modifier.fillMaxWidth().padding(top = 8.dp)) {
|
||||
Text("Keyboard", fontSize = 13.sp)
|
||||
}
|
||||
OutlinedButton(onClick = a.onFrameGen, modifier = Modifier.fillMaxWidth().padding(top = 6.dp)) {
|
||||
Text("Frame generation: ${a.frameGenLabel}", fontSize = 13.sp)
|
||||
}
|
||||
OutlinedButton(onClick = a.onProtons, modifier = Modifier.fillMaxWidth().padding(top = 6.dp)) {
|
||||
Text("Compatibility tools", fontSize = 13.sp)
|
||||
}
|
||||
OutlinedButton(onClick = a.onOsc, modifier = Modifier.fillMaxWidth().padding(top = 6.dp)) {
|
||||
Text("On-screen controls: ${a.oscMode}", fontSize = 13.sp)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user