mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-23 06:46:02 +00:00
fix(setup): trim child-process fix to one line and three actions
This commit is contained in:
3 files changed
+15
-23
No files matched your search
@@ -325,7 +325,7 @@ private fun SmallButton(text: String, enabled: Boolean = true, accent: Boolean =
|
|||||||
val hot = (src.collectIsFocusedAsState().value || src.collectIsHoveredAsState().value) && enabled
|
val hot = (src.collectIsFocusedAsState().value || src.collectIsHoveredAsState().value) && enabled
|
||||||
Box(
|
Box(
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
modifier = modifier.heightIn(min = 40.dp).clip(RoundedCornerShape(10.dp))
|
modifier = modifier.heightIn(min = 44.dp).clip(RoundedCornerShape(10.dp))
|
||||||
.background(if (hot) pal.signal else colors.surfaceVariant)
|
.background(if (hot) pal.signal else colors.surfaceVariant)
|
||||||
.border(2.dp, if (hot) colors.onBackground else pal.line2, RoundedCornerShape(10.dp))
|
.border(2.dp, if (hot) colors.onBackground else pal.line2, RoundedCornerShape(10.dp))
|
||||||
.hoverable(src).clickable(interactionSource = src, indication = null, enabled = enabled, onClick = onClick)
|
.hoverable(src).clickable(interactionSource = src, indication = null, enabled = enabled, onClick = onClick)
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ import androidx.compose.ui.platform.LocalInputModeManager
|
|||||||
import androidx.compose.ui.input.InputMode
|
import androidx.compose.ui.input.InputMode
|
||||||
import androidx.compose.ui.semantics.Role
|
import androidx.compose.ui.semantics.Role
|
||||||
import androidx.compose.ui.semantics.contentDescription
|
import androidx.compose.ui.semantics.contentDescription
|
||||||
import androidx.compose.ui.text.font.FontFamily
|
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
@@ -218,32 +217,25 @@ internal fun SetupPanel(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
AnimatedVisibility(showLimitDetails, enter = expandVertically() + fadeIn(), exit = shrinkVertically() + fadeOut()) {
|
AnimatedVisibility(showLimitDetails, enter = expandVertically() + fadeIn(), exit = shrinkVertically() + fadeOut()) {
|
||||||
|
// One sentence and at most three buttons. The computer route and its
|
||||||
|
// raw command live on the full page Wireless debugging opens.
|
||||||
Column(modifier = Modifier.fillMaxWidth().padding(start = 56.dp, end = 14.dp, top = 4.dp, bottom = 10.dp)) {
|
Column(modifier = Modifier.fillMaxWidth().padding(start = 56.dp, end = 14.dp, top = 4.dp, bottom = 10.dp)) {
|
||||||
Text(
|
Text(
|
||||||
PhantomProcessLimit.instructions(s.phantomProcessStatus),
|
if (limitBlocks) PhantomProcessLimit.gateInstructions(s.phantomProcessStatus)
|
||||||
|
else PhantomProcessLimit.instructions(s.phantomProcessStatus),
|
||||||
fontSize = 14.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(vertical = 4.dp),
|
fontSize = 14.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(vertical = 4.dp),
|
||||||
)
|
)
|
||||||
Row(horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.padding(vertical = 6.dp)) {
|
Actions {
|
||||||
SecondaryButton("Developer options", compact = true, onClick = onOpenDeveloperOptions)
|
if (limitBlocks) {
|
||||||
SecondaryButton("Check again", compact = true, onClick = a.onRefreshPhantomStatus)
|
PrimaryButton("Developer options", compact = true, onClick = onOpenDeveloperOptions)
|
||||||
SecondaryButton("Copy ADB command", compact = true, onClick = { a.onCopyPhantomCommand(false) })
|
SecondaryButton("Use Wireless debugging", compact = true, enabled = !processLimitBusy) { setProcessLimit(false) }
|
||||||
}
|
SecondaryButton("Check again", compact = true, onClick = a.onRefreshPhantomStatus)
|
||||||
Text(
|
} else if (s.phantomProcessStatus == PhantomProcessStatus.DISABLED) {
|
||||||
PhantomProcessLimit.ADB_COMMAND, fontSize = 12.sp, fontFamily = FontFamily.Monospace,
|
SecondaryButton("Turn limit on", compact = true, enabled = !processLimitBusy) { setProcessLimit(true) }
|
||||||
color = colors.onSurfaceVariant, modifier = Modifier.padding(vertical = 4.dp),
|
|
||||||
)
|
|
||||||
if (s.phantomProcessStatus != PhantomProcessStatus.NOT_APPLICABLE) {
|
|
||||||
Text(
|
|
||||||
"With wireless debugging paired, DroidDeck can switch the limit itself. Turning it off is recommended for Steam sessions.",
|
|
||||||
fontSize = 14.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(top = 8.dp),
|
|
||||||
)
|
|
||||||
Row(horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.padding(vertical = 6.dp)) {
|
|
||||||
SecondaryButton("Turn limit off", compact = true, enabled = !processLimitBusy && s.phantomProcessStatus != PhantomProcessStatus.DISABLED) { setProcessLimit(false) }
|
|
||||||
SecondaryButton("Turn limit on", compact = true, enabled = !processLimitBusy && s.phantomProcessStatus != PhantomProcessStatus.ENABLED) { setProcessLimit(true) }
|
|
||||||
}
|
}
|
||||||
if (processLimitBusy) LinearProgressIndicator(modifier = Modifier.fillMaxWidth().padding(vertical = 6.dp))
|
|
||||||
processLimitMessage?.let { Text(it, fontSize = 14.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(vertical = 4.dp)) }
|
|
||||||
}
|
}
|
||||||
|
if (processLimitBusy) LinearProgressIndicator(modifier = Modifier.fillMaxWidth().padding(vertical = 6.dp))
|
||||||
|
processLimitMessage?.let { Text(it, fontSize = 14.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(vertical = 4.dp)) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CheckRow(
|
CheckRow(
|
||||||
|
|||||||
@@ -509,7 +509,7 @@ private fun StopSessionButton(modifier: Modifier = Modifier, onClick: () -> Unit
|
|||||||
val shape = RoundedCornerShape(20.dp)
|
val shape = RoundedCornerShape(20.dp)
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp),
|
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp),
|
||||||
modifier = modifier.heightIn(min = 40.dp).semantics { contentDescription = "Stop session" }
|
modifier = modifier.heightIn(min = 44.dp).semantics { contentDescription = "Stop session" }
|
||||||
.clip(shape).background(fill).border(if (hot) 2.dp else 1.dp, colors.error.copy(alpha = if (hot) 0.9f else 0.55f), shape)
|
.clip(shape).background(fill).border(if (hot) 2.dp else 1.dp, colors.error.copy(alpha = if (hot) 0.9f else 0.55f), shape)
|
||||||
.hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, onClick = onClick)
|
.hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, onClick = onClick)
|
||||||
.controllerConfirm(onClick = onClick)
|
.controllerConfirm(onClick = onClick)
|
||||||
|
|||||||
Reference in new issue
Block a user