From 6618c1863ab321fd05fdc6f20542e32499a07efa Mon Sep 17 00:00:00 2001 From: meyou <2636699780@qq.com> Date: Sat, 16 May 2026 19:32:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E7=8F=AD=E5=9C=A8=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E6=97=B6=E6=B2=BF=E7=94=A8=E6=B3=95=E5=AE=9A=E8=B0=83=E4=BC=91?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F:surface=20=E5=BA=95=20+=20=E5=BD=A9=E8=89=B2?= =?UTF-8?q?=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 默认布局(showLegalHoliday=false)下,右上角排班从实心胶囊改为 surface 背景圆 + 班=primary/休=error 彩色文字,与开启法定调休 时右上角角标视觉规范一致。左上角(showLegalHoliday=true)保持 实心胶囊样式不变,用于区分两类信息。 --- .../commonMain/kotlin/plus/rua/project/ui/DayCell.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 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 795e1d9..74fe74b 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/ui/DayCell.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/ui/DayCell.kt @@ -251,19 +251,23 @@ fun DayCell( } } if (shiftKind != null) { - val shiftBgColor = if (shiftKind == ShiftKind.WORK) { + val shiftAccentColor = if (shiftKind == ShiftKind.WORK) { MaterialTheme.colorScheme.primary } else { MaterialTheme.colorScheme.error } - val shiftFgColor = if (shiftKind == ShiftKind.WORK) { + val shiftOnAccentColor = if (shiftKind == ShiftKind.WORK) { MaterialTheme.colorScheme.onPrimary } else { MaterialTheme.colorScheme.onError } val shiftLabel = if (shiftKind == ShiftKind.WORK) "班" else "休" val shiftAlpha = if (isCurrentMonth) 1f else 0.38f - // showLegalHoliday=true 时排班让位左上角,法定调休占右上角;否则排班独占右上角 + // 右上角(默认)沿用法定调休视觉:surface 背景 + 彩色文字; + // 左上角(showLegalHoliday=true 时)用实心胶囊,与右上角法定调休区分。 + val shiftBgColor = + if (showLegalHoliday) shiftAccentColor else MaterialTheme.colorScheme.surface + val shiftFgColor = if (showLegalHoliday) shiftOnAccentColor else shiftAccentColor val shiftAlignment = if (showLegalHoliday) Alignment.TopStart else Alignment.TopEnd val shiftPadding = if (showLegalHoliday) { Modifier.padding(top = 1.dp, start = 2.dp)