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..fef4ff1197b61a9480105f497b701a07b9d021a4 100644 --- a/src/main/kotlin/org/briarproject/briar/desktop/expiration/ExpirationBanner.kt +++ b/src/main/kotlin/org/briarproject/briar/desktop/expiration/ExpirationBanner.kt @@ -26,6 +26,7 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.sizeIn import androidx.compose.material.Icon import androidx.compose.material.IconButton import androidx.compose.material.MaterialTheme @@ -44,6 +45,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,13 +90,14 @@ fun ExpirationBanner( daysLeft: Int, hide: () -> Unit, ) = Surface( - color = MaterialTheme.colors.error, - modifier = Modifier.fillMaxWidth() + color = MaterialTheme.colors.warningBackground, + contentColor = MaterialTheme.colors.warningForeground, + modifier = Modifier.fillMaxWidth().sizeIn(minHeight = 56.dp) ) { 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)) val text = if (daysLeft == 0) 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 665b828f174f92d4f67c855f34b29c5e9b0bfe26..ff34bd6ed76a0bf035bbae1ff6e24b001b930ff8 100644 --- a/src/main/kotlin/org/briarproject/briar/desktop/theme/Theme.kt +++ b/src/main/kotlin/org/briarproject/briar/desktop/theme/Theme.kt @@ -49,6 +49,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, @@ -56,7 +58,7 @@ val DarkColors = darkColors( secondary = Lime500, background = materialDarkBg, surface = materialDarkBg, - error = briarError, + error = DeepOrange400, onPrimary = Color.White, onSecondary = Color.White, onBackground = Color.White, @@ -69,7 +71,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,