diff --git a/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/ActivityScreen.kt b/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/ActivityScreen.kt index 7624f601..7c6f1f9b 100644 --- a/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/ActivityScreen.kt +++ b/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/ActivityScreen.kt @@ -22,6 +22,8 @@ import com.greenart7c3.nostrsigner.desktop.ui.components.LetterAvatar import com.greenart7c3.nostrsigner.desktop.ui.components.bunkerMethodDescription import com.greenart7c3.nostrsigner.desktop.ui.components.relativeTimeFromNow import com.greenart7c3.nostrsigner.desktop.ui.components.shortenHex +import com.greenart7c3.nostrsigner.desktop.ui.theme.negativeColor +import com.greenart7c3.nostrsigner.desktop.ui.theme.positiveColor @Composable fun ActivityScreen(history: List) { @@ -65,7 +67,7 @@ fun ActivityScreen(history: List) { @Composable private fun ApprovedBadge(approved: Boolean) { - val color = if (approved) Color(0xFF2E7D32) else Color(0xFFC62828) + val color = if (approved) positiveColor else negativeColor Surface(color = color, shape = RoundedCornerShape(4.dp)) { Text( if (approved) "Allowed" else "Rejected", diff --git a/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/AppDetailScreen.kt b/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/AppDetailScreen.kt index 081cb989..1fdcf869 100644 --- a/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/AppDetailScreen.kt +++ b/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/AppDetailScreen.kt @@ -112,7 +112,7 @@ private fun PermissionRow( modifier = Modifier .fillMaxWidth() .padding(vertical = 4.dp) - .border(BorderStroke(1.dp, MaterialTheme.colorScheme.primary), RoundedCornerShape(6.dp)) + .border(BorderStroke(1.dp, MaterialTheme.colorScheme.outline), RoundedCornerShape(6.dp)) .padding(12.dp), ) { Text(bunkerMethodDescription(permission.method, permission.kind), style = MaterialTheme.typography.bodyLarge) diff --git a/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/ConnectedAppsScreen.kt b/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/ConnectedAppsScreen.kt index 1e3b0ac7..06aeee04 100644 --- a/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/ConnectedAppsScreen.kt +++ b/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/ConnectedAppsScreen.kt @@ -51,7 +51,7 @@ fun ConnectedAppsScreen(connectedApps: List, onAppClick: (String) Text("Last used ${relativeTimeFromNow(app.connectedAt)}", style = MaterialTheme.typography.bodySmall) } } - HorizontalDivider(color = MaterialTheme.colorScheme.primary) + HorizontalDivider(color = MaterialTheme.colorScheme.outline) } } } diff --git a/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/HomeScreen.kt b/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/HomeScreen.kt index 06b227ab..ebcc22c3 100644 --- a/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/HomeScreen.kt +++ b/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/HomeScreen.kt @@ -20,6 +20,8 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import com.greenart7c3.nostrsigner.desktop.ui.components.LetterAvatar import com.greenart7c3.nostrsigner.desktop.ui.components.shortenHex +import com.greenart7c3.nostrsigner.desktop.ui.theme.negativeColor +import com.greenart7c3.nostrsigner.desktop.ui.theme.positiveColor @Composable fun HomeScreen( @@ -52,7 +54,7 @@ fun HomeScreen( "Connected to $connectedRelayCount of $totalRelays relays" }, style = MaterialTheme.typography.bodySmall, - color = if (connectedRelayCount > 0) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.error, + color = if (connectedRelayCount > 0) positiveColor else negativeColor, ) Spacer(Modifier.height(24.dp)) diff --git a/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/theme/DesktopTheme.kt b/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/theme/DesktopTheme.kt index 5187b390..62858240 100644 --- a/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/theme/DesktopTheme.kt +++ b/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/theme/DesktopTheme.kt @@ -15,23 +15,51 @@ val primaryVariant = Color(0xFFC8541A) val secondaryColor = Color(0xFFFFCA62) val orange = Color(0xFFFF6B00) +/** + * `primary`/`tertiary`/`primaryContainer`/`secondaryContainer` are all a light gold in both + * schemes, so their paired `on*` roles need an explicit dark color — Material3's baseline + * defaults (tuned for the default purple palette) don't have guaranteed contrast against a + * custom light container and were left unset here before, making button/nav-rail text + * unreadable. + */ +val inkColor = Color(0xFF3E2A0D) +val outlineColor = Color(0xFF8A6D3A) +val positiveColor = Color(0xFF2E7D32) +val negativeColor = Color(0xFFC62828) + private val DarkColorPalette = darkColorScheme( primary = primaryColor, - onPrimary = Color.White, + onPrimary = inkColor, secondary = primaryVariant, + onSecondary = Color.White, tertiary = secondaryColor, + onTertiary = inkColor, primaryContainer = secondaryColor, + onPrimaryContainer = inkColor, secondaryContainer = secondaryColor, + onSecondaryContainer = inkColor, ) +private val surfaceColor = Color(0xFFFFDE9E) + private val LightColorPalette = lightColorScheme( primary = primaryColor, + onPrimary = inkColor, secondary = primaryVariant, + onSecondary = Color.White, tertiary = secondaryColor, + onTertiary = inkColor, primaryContainer = secondaryColor, + onPrimaryContainer = inkColor, secondaryContainer = secondaryColor, - surface = Color(0xFFFFDE9E), - surfaceContainer = Color(0xFFFFDE9E), + onSecondaryContainer = inkColor, + surface = surfaceColor, + surfaceContainer = surfaceColor, + onSurface = inkColor, + onSurfaceVariant = inkColor, + background = surfaceColor, + onBackground = inkColor, + outline = outlineColor, ) val DesktopShapes = Shapes(