From de8cb4334bdc038d5e07caa8f77674f59537fc67 Mon Sep 17 00:00:00 2001 From: xfy Date: Thu, 14 May 2026 17:50:25 +0800 Subject: [PATCH] Use border outline instead of filled background for today indicator Co-Authored-By: Claude Opus 4.7 --- .../kotlin/plus/rua/project/ui/DayCell.kt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/shared/src/commonMain/kotlin/plus/rua/project/ui/DayCell.kt b/shared/src/commonMain/kotlin/plus/rua/project/ui/DayCell.kt index 52ce41f..2658e5d 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/ui/DayCell.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/ui/DayCell.kt @@ -1,6 +1,8 @@ package plus.rua.project.ui +import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.background +import androidx.compose.foundation.border import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.aspectRatio @@ -11,6 +13,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip +import androidx.compose.ui.unit.dp import androidx.compose.ui.text.style.TextAlign import kotlinx.datetime.LocalDate @@ -35,20 +38,22 @@ fun DayCell( ) { val contentColor = when { isSelected -> MaterialTheme.colorScheme.onPrimary + isToday -> MaterialTheme.colorScheme.primary !isCurrentMonth -> MaterialTheme.colorScheme.onSurface.copy(alpha = 0.38f) else -> MaterialTheme.colorScheme.onSurface } - val backgroundColor = when { - isSelected -> MaterialTheme.colorScheme.primary - else -> MaterialTheme.colorScheme.surface - } - Box( modifier = modifier .aspectRatio(1f) .clip(CircleShape) - .background(backgroundColor) + .then( + when { + isSelected -> Modifier.background(MaterialTheme.colorScheme.primary) + isToday -> Modifier.border(BorderStroke(1.5.dp, MaterialTheme.colorScheme.primary), CircleShape) + else -> Modifier + } + ) .clickable(onClick = onClick), contentAlignment = Alignment.Center ) {