mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-26 03:14:36 +00:00
NetworkAndServers: rewrite UseSocksProxySwitch via SettingsActionItemWithContent
UseSocksProxySwitch was a custom Row with hard-coded horizontal padding of DEFAULT_PADDING (20dp) — but its neighbours on the messages card are SettingsActionItem rows that go through SectionItemView with the new CARD_ITEM_PADDING (15dp). 5dp icon misalignment between the SOCKS toggle row and the rest, plus no auto-divider underneath since it wasn't a SectionItemView. Replace the custom Row with SettingsActionItemWithContent — same icon + label + DefaultSwitch shape, now wrapped in SectionItemView so it shares padding and auto-divider with siblings. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+3
-16
@@ -339,23 +339,10 @@ fun UseSocksProxySwitch(
|
||||
networkUseSocksProxy: MutableState<Boolean>,
|
||||
toggleSocksProxy: (Boolean) -> Unit,
|
||||
) {
|
||||
Row(
|
||||
Modifier.fillMaxWidth().padding(end = DEFAULT_PADDING),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.SpaceBetween
|
||||
SettingsActionItemWithContent(
|
||||
icon = painterResource(MR.images.ic_settings_ethernet),
|
||||
text = stringResource(MR.strings.network_socks_toggle_use_socks_proxy),
|
||||
) {
|
||||
Row(
|
||||
Modifier.weight(1f).padding(horizontal = DEFAULT_PADDING),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Icon(
|
||||
painterResource(MR.images.ic_settings_ethernet),
|
||||
stringResource(MR.strings.network_socks_toggle_use_socks_proxy),
|
||||
tint = MaterialTheme.colors.secondary
|
||||
)
|
||||
TextIconSpaced(false)
|
||||
Text(generalGetString(MR.strings.network_socks_toggle_use_socks_proxy))
|
||||
}
|
||||
DefaultSwitch(
|
||||
checked = networkUseSocksProxy.value,
|
||||
onCheckedChange = toggleSocksProxy,
|
||||
|
||||
Reference in New Issue
Block a user