fix: clean up mode pills — remove muddy amber tint, use solid surface fills
Active pills now use cs.surface at high opacity instead of transparent Amber overlay. Removed amber from borders and icons, unified to neutral glass border. Active state distinguished by higher fill + semibold weight.
This commit is contained in:
parent
5804b337d9
commit
78f03ada99
1 changed files with 11 additions and 12 deletions
|
|
@ -148,12 +148,9 @@ fun ModePillsRow(selected: Int, onSelect: (Int) -> Unit, modifier: Modifier = Mo
|
|||
val cs = MaterialTheme.colorScheme
|
||||
val isDark = isSystemInDarkTheme()
|
||||
|
||||
val glassBorderInactive = remember(isDark) {
|
||||
if (isDark) Brush.verticalGradient(listOf(Color.White.copy(alpha = 0.12f), Color.White.copy(alpha = 0.02f)))
|
||||
else Brush.verticalGradient(listOf(Color.White.copy(alpha = 0.45f), Color.Black.copy(alpha = 0.04f)))
|
||||
}
|
||||
val glassBorderActive = remember(isDark) {
|
||||
Brush.verticalGradient(listOf(Amber.copy(alpha = 0.50f), Amber.copy(alpha = 0.15f)))
|
||||
val glassBorder = remember(isDark) {
|
||||
if (isDark) Brush.verticalGradient(listOf(Color.White.copy(alpha = 0.14f), Color.White.copy(alpha = 0.04f)))
|
||||
else Brush.verticalGradient(listOf(Color.White.copy(alpha = 0.50f), Color.Black.copy(alpha = 0.06f)))
|
||||
}
|
||||
|
||||
Row(
|
||||
|
|
@ -166,22 +163,24 @@ fun ModePillsRow(selected: Int, onSelect: (Int) -> Unit, modifier: Modifier = Mo
|
|||
chatModes.forEach { mode ->
|
||||
val label = stringResource(mode.labelRes)
|
||||
val active = mode.labelRes == selected
|
||||
val backgroundFill = if (active) Amber.copy(alpha = 0.16f)
|
||||
else if (isDark) Color(0x12FFFFFF) else Color(0x82FFFFFF)
|
||||
val borderBrush = if (active) glassBorderActive else glassBorderInactive
|
||||
val backgroundFill = if (active) {
|
||||
if (isDark) cs.surface.copy(alpha = 0.8f) else cs.surface.copy(alpha = 0.88f)
|
||||
} else {
|
||||
if (isDark) cs.surface.copy(alpha = 0.35f) else cs.surface.copy(alpha = 0.55f)
|
||||
}
|
||||
|
||||
Row(
|
||||
Modifier
|
||||
.clip(KaizenShapes.pill)
|
||||
.background(backgroundFill)
|
||||
.border(1.2.dp, borderBrush, KaizenShapes.pill)
|
||||
.border(1.2.dp, glassBorder, KaizenShapes.pill)
|
||||
.clickable { onSelect(mode.labelRes) }
|
||||
.padding(horizontal = 13.dp, vertical = 8.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Icon(mode.icon, null, tint = if (active) Amber else cs.onSurfaceVariant, modifier = Modifier.size(16.dp))
|
||||
Icon(mode.icon, null, tint = if (active) cs.onBackground else cs.onSurfaceVariant, modifier = Modifier.size(16.dp))
|
||||
Spacer(Modifier.width(6.dp))
|
||||
Text(label, color = if (active) cs.onBackground else cs.onSurfaceVariant, fontSize = 13.sp, fontWeight = FontWeight.Medium)
|
||||
Text(label, color = if (active) cs.onBackground else cs.onSurfaceVariant, fontSize = 13.sp, fontWeight = if (active) FontWeight.SemiBold else FontWeight.Medium)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue