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:
+29
-12
@@ -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
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user