v0.9.1: larger send button, input focus on terminal
- Send button increased: 36dp → 48dp, larger ↵ icon - Terminal input field now gets auto focus on connect - Button uses accentBlue theme for better visibility
This commit is contained in:
@@ -21,6 +21,8 @@ import androidx.compose.material.icons.outlined.Lock
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.focus.FocusRequester
|
||||
import androidx.compose.ui.focus.focusRequester
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.SolidColor
|
||||
@@ -444,7 +446,7 @@ fun SshTerminalScreen(
|
||||
}
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(2.dp)) {
|
||||
if (state.connected) {
|
||||
// 复制按钮
|
||||
// 复制按钮 — 放大触摸区域
|
||||
IconButton(onClick = {
|
||||
val clip = context.getSystemService(android.content.ClipboardManager::class.java)
|
||||
val text = state.lines.joinToString("\n")
|
||||
@@ -589,6 +591,8 @@ fun SshTerminalScreen(
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontSize = 13.sp
|
||||
)
|
||||
val focusRequester = remember { FocusRequester() }
|
||||
LaunchedEffect(Unit) { focusRequester.requestFocus() }
|
||||
Box(modifier = Modifier.weight(1f)) {
|
||||
BasicTextField(
|
||||
value = input,
|
||||
@@ -599,7 +603,7 @@ fun SshTerminalScreen(
|
||||
fontFamily = FontFamily.Monospace
|
||||
),
|
||||
cursorBrush = SolidColor(accentBlue),
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
modifier = Modifier.fillMaxWidth().focusRequester(focusRequester),
|
||||
decorationBox = { innerTextField ->
|
||||
if (input.text.isEmpty()) {
|
||||
Text(
|
||||
@@ -613,7 +617,8 @@ fun SshTerminalScreen(
|
||||
}
|
||||
)
|
||||
}
|
||||
IconButton(
|
||||
// 发送按钮 — 放大
|
||||
Button(
|
||||
onClick = {
|
||||
if (input.text.isNotBlank()) {
|
||||
coroutineScope.launch {
|
||||
@@ -622,9 +627,15 @@ fun SshTerminalScreen(
|
||||
}
|
||||
}
|
||||
},
|
||||
modifier = Modifier.size(36.dp)
|
||||
modifier = Modifier.size(48.dp),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = accentBlue.copy(alpha = 0.15f),
|
||||
contentColor = accentBlue
|
||||
),
|
||||
shape = RoundedCornerShape(8.dp),
|
||||
contentPadding = PaddingValues(0.dp)
|
||||
) {
|
||||
Text("↵", color = accentBlue, fontSize = 16.sp)
|
||||
Text("↵", fontSize = 20.sp, fontWeight = FontWeight.Bold)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user