feat: show profile name in ConfigPanel
This commit is contained in:
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
~~什么我居然开始写更新日志了~~
|
~~什么我居然开始写更新日志了~~
|
||||||
|
|
||||||
|
## 0.2.2
|
||||||
|
|
||||||
|
- 改进: 设备页连接设备后选项卡显示当前配置名
|
||||||
|
|
||||||
## 0.2.1
|
## 0.2.1
|
||||||
|
|
||||||
- 改进: 全屏虚拟按钮更多调整选项
|
- 改进: 全屏虚拟按钮更多调整选项
|
||||||
|
|||||||
@@ -317,6 +317,12 @@ fun DeviceTabPage(
|
|||||||
adbSession.connectedScrcpyProfileId
|
adbSession.connectedScrcpyProfileId
|
||||||
|
|
||||||
val connectedScrcpyBundle = resolveScrcpyBundle(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 apps = remember(listingsRefreshVersion) { scrcpy.listings.apps }
|
||||||
val recentTasks = remember(listingsRefreshVersion) { scrcpy.listings.recentTasks }
|
val recentTasks = remember(listingsRefreshVersion) { scrcpy.listings.recentTasks }
|
||||||
|
|
||||||
@@ -1064,6 +1070,7 @@ fun DeviceTabPage(
|
|||||||
cameraMirroringSupported = adbSession.cameraMirroringSupported,
|
cameraMirroringSupported = adbSession.cameraMirroringSupported,
|
||||||
adbConnecting = adbConnecting,
|
adbConnecting = adbConnecting,
|
||||||
isQuickConnected = isQuickConnected,
|
isQuickConnected = isQuickConnected,
|
||||||
|
advancedEndActionText = connectedScrcpyProfileName,
|
||||||
allAppsEndActionText = when {
|
allAppsEndActionText = when {
|
||||||
listingsRefreshBusy -> "..."
|
listingsRefreshBusy -> "..."
|
||||||
apps.isNotEmpty() -> apps.size.toString()
|
apps.isNotEmpty() -> apps.size.toString()
|
||||||
|
|||||||
@@ -70,8 +70,8 @@ fun SuperSlider(
|
|||||||
val text = if (shouldShowUnit) "$valueText $unit" else valueText
|
val text = if (shouldShowUnit) "$valueText $unit" else valueText
|
||||||
Text(
|
Text(
|
||||||
text = text,
|
text = text,
|
||||||
fontSize = textStyles.body2.fontSize,
|
|
||||||
color = colorScheme.onSurfaceVariantActions,
|
color = colorScheme.onSurfaceVariantActions,
|
||||||
|
fontSize = textStyles.body2.fontSize,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
enabled = enabled,
|
enabled = enabled,
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ import androidx.compose.ui.platform.LocalFocusManager
|
|||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.input.ImeAction
|
import androidx.compose.ui.text.input.ImeAction
|
||||||
import androidx.compose.ui.text.input.KeyboardType
|
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.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
@@ -416,6 +417,7 @@ internal fun ConfigPanel(
|
|||||||
cameraMirroringSupported: Boolean,
|
cameraMirroringSupported: Boolean,
|
||||||
adbConnecting: Boolean,
|
adbConnecting: Boolean,
|
||||||
isQuickConnected: Boolean,
|
isQuickConnected: Boolean,
|
||||||
|
advancedEndActionText: String,
|
||||||
allAppsEndActionText: String,
|
allAppsEndActionText: String,
|
||||||
onOpenAllApps: () -> Unit,
|
onOpenAllApps: () -> Unit,
|
||||||
recentTasksEndActionText: String,
|
recentTasksEndActionText: String,
|
||||||
@@ -603,6 +605,13 @@ internal fun ConfigPanel(
|
|||||||
ArrowPreference(
|
ArrowPreference(
|
||||||
title = if (!hideSimpleConfigItems) "更多参数" else "所有参数",
|
title = if (!hideSimpleConfigItems) "更多参数" else "所有参数",
|
||||||
summary = "所有 scrcpy 参数",
|
summary = "所有 scrcpy 参数",
|
||||||
|
endActions = {
|
||||||
|
Text(
|
||||||
|
text = advancedEndActionText,
|
||||||
|
color = colorScheme.onSurfaceVariantActions,
|
||||||
|
fontSize = textStyles.body2.fontSize,
|
||||||
|
)
|
||||||
|
},
|
||||||
onClick = onOpenAdvanced,
|
onClick = onOpenAdvanced,
|
||||||
enabled = !sessionStarted,
|
enabled = !sessionStarted,
|
||||||
)
|
)
|
||||||
@@ -614,7 +623,6 @@ internal fun ConfigPanel(
|
|||||||
text = allAppsEndActionText,
|
text = allAppsEndActionText,
|
||||||
color = colorScheme.onSurfaceVariantActions,
|
color = colorScheme.onSurfaceVariantActions,
|
||||||
fontSize = textStyles.body2.fontSize,
|
fontSize = textStyles.body2.fontSize,
|
||||||
modifier = Modifier.padding(end = UiSpacing.ContentVertical),
|
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
onClick = onOpenAllApps,
|
onClick = onOpenAllApps,
|
||||||
@@ -627,7 +635,6 @@ internal fun ConfigPanel(
|
|||||||
text = recentTasksEndActionText,
|
text = recentTasksEndActionText,
|
||||||
color = colorScheme.onSurfaceVariantActions,
|
color = colorScheme.onSurfaceVariantActions,
|
||||||
fontSize = textStyles.body2.fontSize,
|
fontSize = textStyles.body2.fontSize,
|
||||||
modifier = Modifier.padding(end = UiSpacing.ContentVertical),
|
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
onClick = onOpenRecentTasks,
|
onClick = onOpenRecentTasks,
|
||||||
|
|||||||
Reference in New Issue
Block a user