e113d05ed932

polish: SettingsStack minor corrections — card gradients now CSS 155° across draw size (spec §5.5); verified settingsActive/Tab/Lede fonts + Pro sparkle already conform (v2.1.16)

time
2026-06-08 20:11 UTC · 5 months ago
machine
koh2
agent
claude-opus-4-8
session
vault visual parity v2
parent
fa9783a59258
1 file app/src/main/java/com/peachpasswords/ui/settings/SettingsScreen.kt+22 −1
app/src/main/java/com/peachpasswords/ui/settings/SettingsScreen.kt+22 −1
@@ -40,10 +40,12 @@4040 import androidx.compose.ui.draw.clip4141 import androidx.compose.ui.draw.drawWithCache4242 import androidx.compose.ui.draw.shadow43+import androidx.compose.ui.draw.drawBehind4344 import androidx.compose.ui.geometry.Offset4445 import androidx.compose.ui.graphics.BlendMode4546 import androidx.compose.ui.graphics.Brush4647 import androidx.compose.ui.graphics.Color48+import androidx.compose.ui.graphics.drawscope.DrawScope4749 import androidx.compose.ui.graphics.graphicsLayer4850 import androidx.compose.ui.platform.LocalDensity4951 import androidx.compose.ui.text.font.FontStyle@@ -267,7 +269,7 @@267269         modifier268270             .shadow(if (active) 18.dp else 8.dp, RoundedCornerShape(PeachStackColors.CardRadius), clip = false)269271             .clip(RoundedCornerShape(PeachStackColors.CardRadius))270-            .background(Brush.linearGradient(listOf(spec.bgStart, spec.bgEnd)))272+            .drawBehind { drawRect(brush = cardGradient155(spec.bgStart, spec.bgEnd)) }271273             .clickable(272274                 interactionSource = interaction,273275                 indication = null,@@ -344,6 +346,25 @@344346             }345347         }346348     }349+}350+351+/**352+ * Settings card gradient at CSS 155° across the drawn card (spec §5.5). Computed353+ * from the live draw size so the angle holds on any card height, unlike Compose's354+ * default corner-to-corner linear gradient.355+ */356+private fun DrawScope.cardGradient155(start: Color, end: Color): Brush {357+    val a = Math.toRadians(155.0)358+    val dx = kotlin.math.sin(a).toFloat()359+    val dy = -kotlin.math.cos(a).toFloat()360+    val cx = size.width / 2f361+    val cy = size.height / 2f362+    val half = (kotlin.math.abs(dx) * size.width + kotlin.math.abs(dy) * size.height) / 2f363+    return Brush.linearGradient(364+        colors = listOf(start, end),365+        start = Offset(cx - dx * half, cy - dy * half),366+        end = Offset(cx + dx * half, cy + dy * half),367+    )347368 }348369 349370 /**

view file