diff --git a/src/main/kotlin/org/briarproject/briar/desktop/expiration/ExpirationBanner.kt b/src/main/kotlin/org/briarproject/briar/desktop/expiration/ExpirationBanner.kt index e7d6995061bb7c36189a6b5d248b7b86ac30a5e7..a2b206d18a77939f1bc1702b0ce5bb42b95355cf 100644 --- a/src/main/kotlin/org/briarproject/briar/desktop/expiration/ExpirationBanner.kt +++ b/src/main/kotlin/org/briarproject/briar/desktop/expiration/ExpirationBanner.kt @@ -44,6 +44,8 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import org.briarproject.briar.desktop.expiration.ExpirationUtils.periodicallyCheckIfExpired +import org.briarproject.briar.desktop.theme.warningBackground +import org.briarproject.briar.desktop.theme.warningForeground import org.briarproject.briar.desktop.utils.InternationalizationUtils.i18n import org.briarproject.briar.desktop.utils.InternationalizationUtils.i18nP import org.briarproject.briar.desktop.utils.PreviewUtils.preview @@ -87,15 +89,16 @@ fun ExpirationBanner( daysLeft: Int, hide: () -> Unit, ) = Surface( - color = MaterialTheme.colors.error, + color = MaterialTheme.colors.warningBackground, + contentColor = MaterialTheme.colors.warningForeground, modifier = Modifier.fillMaxWidth() ) { Row( horizontalArrangement = Arrangement.spacedBy(24.dp), verticalAlignment = Alignment.CenterVertically, - modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp) + modifier = Modifier.padding(horizontal = 16.dp) ) { - Icon(Icons.Filled.Warning, i18n("warning"), Modifier.size(40.dp)) + Icon(Icons.Filled.Warning, i18n("warning"), Modifier.size(40.dp).padding(vertical = 4.dp)) val text = if (daysLeft == 0) "${i18n("expiration.banner.part1.zero")} ${i18n("expiration.banner.part2")}" else @@ -103,9 +106,9 @@ fun ExpirationBanner( Text( text = text, style = MaterialTheme.typography.body2, - modifier = Modifier.weight(1f, true) + modifier = Modifier.weight(1f, true).padding(vertical = 12.dp) ) - IconButton(hide) { + IconButton(hide, modifier = Modifier.padding(vertical = 4.dp)) { Icon(Icons.Filled.Close, i18n("hide"), Modifier.size(24.dp)) } } diff --git a/src/main/kotlin/org/briarproject/briar/desktop/theme/Colors.kt b/src/main/kotlin/org/briarproject/briar/desktop/theme/Colors.kt index 87d720e5931a511d69acae49de2ae869c89a3ba7..7ff1bedee63ef77f5e8c6eddb1f5983c66cb408b 100644 --- a/src/main/kotlin/org/briarproject/briar/desktop/theme/Colors.kt +++ b/src/main/kotlin/org/briarproject/briar/desktop/theme/Colors.kt @@ -41,6 +41,11 @@ val materialDarkBg = Color(0xff121212) val Red500 = Color(0xffdb3b21) val Orange500 = Color(0xfffc9403) +// taken from Android AppCompat DayNight theme as error colors +// https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-appcompat-release/appcompat/appcompat/src/main/res/values/colors_material.xml#102 +val DeepOrange400 = Color(0xffff7043) +val DeepOrange500 = Color(0xffff5722) + val Blue400 = Color(0xff418cd8) val Blue500 = Color(0xff1f78d1) // todo: unused in Android val Blue600 = Color(0xff1b69b6) diff --git a/src/main/kotlin/org/briarproject/briar/desktop/theme/Theme.kt b/src/main/kotlin/org/briarproject/briar/desktop/theme/Theme.kt index 5c3437de245f2800a8375592c407ffc7e34b586a..69d6ae7d859ab7e76df8b2c0305f84686962f730 100644 --- a/src/main/kotlin/org/briarproject/briar/desktop/theme/Theme.kt +++ b/src/main/kotlin/org/briarproject/briar/desktop/theme/Theme.kt @@ -50,6 +50,8 @@ val Colors.textSecondary: Color get() = if (isLight) TextSecondaryMaterialLight val Colors.privateMessageDate: Color get() = Gray200 val Colors.buttonTextNegative: Color get() = Red500 val Colors.buttonTextPositive: Color get() = Blue400 +val Colors.warningBackground get() = Red500 +val Colors.warningForeground get() = Color.White val DarkColors = darkColors( primary = Blue500, @@ -57,7 +59,7 @@ val DarkColors = darkColors( secondary = Lime500, background = materialDarkBg, surface = materialDarkBg, - error = briarError, + error = DeepOrange400, onPrimary = Color.White, onSecondary = Color.White, onBackground = Color.White, @@ -70,7 +72,7 @@ val LightColors = lightColors( secondary = Lime300, background = Color.White, surface = Color.White, - error = briarError, + error = DeepOrange500, onPrimary = Color.White, onSecondary = Color.Black, onBackground = Color.Black,