mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-05-09 04:13:28 -05:00
Put players table in an OutlinedBox, makes the UI look more consistent.
This commit is contained in:
parent
a5bd27d731
commit
64fd5de16b
|
|
@ -192,15 +192,25 @@ private fun PLayersAndSettings(
|
|||
|
||||
MenuSpacer()
|
||||
|
||||
PlayersTable(
|
||||
rows = buildList {
|
||||
add(listOf("Player", "Ping", "Mapping"))
|
||||
addAll(players.map { listOf(it.name, it.ping.toString(), it.mapping) })
|
||||
repeat(4 - players.size) { add(listOf("", "", "")) }
|
||||
},
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
)
|
||||
OutlinedBox(
|
||||
label = { Text(stringResource(R.string.netplay_players_label)) },
|
||||
) {
|
||||
PlayersTable(
|
||||
rows = buildList {
|
||||
add(
|
||||
listOf(
|
||||
stringResource(R.string.netplay_players_name),
|
||||
stringResource(R.string.netplay_players_ping),
|
||||
stringResource(R.string.netplay_players_mapping),
|
||||
)
|
||||
)
|
||||
addAll(players.map { listOf(it.name, it.ping.toString(), it.mapping) })
|
||||
repeat(4 - players.size) { add(listOf("", "", "")) }
|
||||
},
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -135,9 +135,10 @@ fun MenuSpacer() = Spacer(modifier = Modifier.height(16.dp))
|
|||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun OutlinedBox(
|
||||
onClick: () -> Unit,
|
||||
label: @Composable () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
onClick: (() -> Unit)? = null,
|
||||
fadeContentTop: Boolean = false,
|
||||
content: @Composable () -> Unit,
|
||||
) {
|
||||
Box(
|
||||
|
|
@ -153,24 +154,30 @@ fun OutlinedBox(
|
|||
.fillMaxSize()
|
||||
) {
|
||||
content()
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(16.dp)
|
||||
.background(
|
||||
Brush.verticalGradient(
|
||||
colors = listOf(
|
||||
MaterialTheme.colorScheme.surface,
|
||||
Color.Transparent
|
||||
if (fadeContentTop) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(16.dp)
|
||||
.background(
|
||||
Brush.verticalGradient(
|
||||
colors = listOf(
|
||||
MaterialTheme.colorScheme.surface,
|
||||
Color.Transparent
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
enabled = true,
|
||||
singleLine = false,
|
||||
contentPadding = OutlinedTextFieldDefaults.contentPadding(top = 0.dp),
|
||||
contentPadding = if (fadeContentTop) {
|
||||
OutlinedTextFieldDefaults.contentPadding(top = 0.dp)
|
||||
} else {
|
||||
OutlinedTextFieldDefaults.contentPadding()
|
||||
},
|
||||
visualTransformation = VisualTransformation.None,
|
||||
interactionSource = interactionSource,
|
||||
label = { label() },
|
||||
|
|
@ -183,15 +190,17 @@ fun OutlinedBox(
|
|||
)
|
||||
}
|
||||
)
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.clip(MaterialTheme.shapes.extraSmall)
|
||||
.clickable(
|
||||
interactionSource = interactionSource,
|
||||
indication = LocalIndication.current,
|
||||
onClick = onClick,
|
||||
)
|
||||
)
|
||||
if (onClick != null) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.clip(MaterialTheme.shapes.extraSmall)
|
||||
.clickable(
|
||||
interactionSource = interactionSource,
|
||||
indication = LocalIndication.current,
|
||||
onClick = onClick,
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1003,4 +1003,8 @@ It can efficiently compress both junk data and encrypted Wii data.
|
|||
<string name="netplay_message_buffer_changed">Buffer size changed to %1$d</string>
|
||||
<string name="netplay_message_host_input_authority_changed">"Host input authority %1$s"</string>
|
||||
<string name="netplay_game_label">Game</string>
|
||||
<string name="netplay_players_label">Players</string>
|
||||
<string name="netplay_players_name">Name</string>
|
||||
<string name="netplay_players_ping">Ping</string>
|
||||
<string name="netplay_players_mapping">Mapping</string>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user