feat: show profile name in ConfigPanel
This commit is contained in:
@@ -317,6 +317,12 @@ fun DeviceTabPage(
|
||||
adbSession.connectedScrcpyProfileId
|
||||
|
||||
val connectedScrcpyBundle = resolveScrcpyBundle(connectedScrcpyProfileId)
|
||||
val connectedScrcpyProfileName = remember(connectedScrcpyProfileId, scrcpyProfilesState) {
|
||||
scrcpyProfilesState.profiles
|
||||
.firstOrNull { it.id == connectedScrcpyProfileId }
|
||||
?.name
|
||||
?: ScrcpyOptions.GLOBAL_PROFILE_NAME
|
||||
}
|
||||
val apps = remember(listingsRefreshVersion) { scrcpy.listings.apps }
|
||||
val recentTasks = remember(listingsRefreshVersion) { scrcpy.listings.recentTasks }
|
||||
|
||||
@@ -1064,6 +1070,7 @@ fun DeviceTabPage(
|
||||
cameraMirroringSupported = adbSession.cameraMirroringSupported,
|
||||
adbConnecting = adbConnecting,
|
||||
isQuickConnected = isQuickConnected,
|
||||
advancedEndActionText = connectedScrcpyProfileName,
|
||||
allAppsEndActionText = when {
|
||||
listingsRefreshBusy -> "..."
|
||||
apps.isNotEmpty() -> apps.size.toString()
|
||||
|
||||
@@ -70,8 +70,8 @@ fun SuperSlider(
|
||||
val text = if (shouldShowUnit) "$valueText $unit" else valueText
|
||||
Text(
|
||||
text = text,
|
||||
fontSize = textStyles.body2.fontSize,
|
||||
color = colorScheme.onSurfaceVariantActions,
|
||||
fontSize = textStyles.body2.fontSize,
|
||||
)
|
||||
},
|
||||
enabled = enabled,
|
||||
|
||||
@@ -57,6 +57,7 @@ import androidx.compose.ui.platform.LocalFocusManager
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.input.ImeAction
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
@@ -416,6 +417,7 @@ internal fun ConfigPanel(
|
||||
cameraMirroringSupported: Boolean,
|
||||
adbConnecting: Boolean,
|
||||
isQuickConnected: Boolean,
|
||||
advancedEndActionText: String,
|
||||
allAppsEndActionText: String,
|
||||
onOpenAllApps: () -> Unit,
|
||||
recentTasksEndActionText: String,
|
||||
@@ -603,6 +605,13 @@ internal fun ConfigPanel(
|
||||
ArrowPreference(
|
||||
title = if (!hideSimpleConfigItems) "更多参数" else "所有参数",
|
||||
summary = "所有 scrcpy 参数",
|
||||
endActions = {
|
||||
Text(
|
||||
text = advancedEndActionText,
|
||||
color = colorScheme.onSurfaceVariantActions,
|
||||
fontSize = textStyles.body2.fontSize,
|
||||
)
|
||||
},
|
||||
onClick = onOpenAdvanced,
|
||||
enabled = !sessionStarted,
|
||||
)
|
||||
@@ -614,7 +623,6 @@ internal fun ConfigPanel(
|
||||
text = allAppsEndActionText,
|
||||
color = colorScheme.onSurfaceVariantActions,
|
||||
fontSize = textStyles.body2.fontSize,
|
||||
modifier = Modifier.padding(end = UiSpacing.ContentVertical),
|
||||
)
|
||||
},
|
||||
onClick = onOpenAllApps,
|
||||
@@ -627,7 +635,6 @@ internal fun ConfigPanel(
|
||||
text = recentTasksEndActionText,
|
||||
color = colorScheme.onSurfaceVariantActions,
|
||||
fontSize = textStyles.body2.fontSize,
|
||||
modifier = Modifier.padding(end = UiSpacing.ContentVertical),
|
||||
)
|
||||
},
|
||||
onClick = onOpenRecentTasks,
|
||||
|
||||
Reference in New Issue
Block a user