fix(desktop): icon picker shows selected state with background highlight

Replace tint-only selection with Surface background + primaryContainer
color so the selected icon is clearly visible in the workspace editor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
nrobi144
2026-04-19 05:55:09 +03:00
parent 486ff2e8cf
commit cb306b5219
@@ -904,19 +904,36 @@ private fun WorkspaceEditorDialog(
) )
// Icon picker // Icon picker
Text("Icon", style = MaterialTheme.typography.labelMedium) Text("Icon", style = MaterialTheme.typography.labelMedium)
FlowRow(horizontalArrangement = Arrangement.spacedBy(4.dp)) { FlowRow(
horizontalArrangement = Arrangement.spacedBy(4.dp),
verticalArrangement = Arrangement.spacedBy(4.dp),
) {
val isSelected = { iName: String -> iName == iconName }
WorkspaceIcons.availableNames.forEach { iName -> WorkspaceIcons.availableNames.forEach { iName ->
IconButton(onClick = { iconName = iName }) { Surface(
Icon( modifier = Modifier.size(40.dp).clickable { iconName = iName },
WorkspaceIcons.resolve(iName), shape = RoundedCornerShape(8.dp),
iName, color =
tint = if (isSelected(iName)) {
if (iName == iconName) { MaterialTheme.colorScheme.primaryContainer
MaterialTheme.colorScheme.primary } else {
} else { Color.Transparent
MaterialTheme.colorScheme.onSurfaceVariant },
}, tonalElevation = if (isSelected(iName)) 4.dp else 0.dp,
) ) {
Box(contentAlignment = Alignment.Center) {
Icon(
WorkspaceIcons.resolve(iName),
iName,
modifier = Modifier.size(24.dp),
tint =
if (isSelected(iName)) {
MaterialTheme.colorScheme.primary
} else {
MaterialTheme.colorScheme.onSurfaceVariant
},
)
}
} }
} }
} }