diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperDropdown.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperDropdown.kt index db2a7906..4bd00895 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperDropdown.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperDropdown.kt @@ -191,7 +191,7 @@ fun SuperDropdown( var offsetXPx by remember { mutableStateOf(0) } var offsetYPx by remember { mutableStateOf(0) } val textMeasurer = rememberTextMeasurer() - val textStyle = remember { TextStyle(fontWeight = FontWeight.Medium, fontSize = 17.sp) } + val textStyle = remember { TextStyle(fontWeight = FontWeight.Medium, fontSize = 16.sp) } val textWidthDp = remember(items) { items.maxOfOrNull { with(density) { textMeasurer.measure(text = it, style = textStyle).size.width.toDp() } } } val getWindowSize = rememberUpdatedState(getWindowSize()) val windowHeightPx by rememberUpdatedState(getWindowSize.value.height) @@ -207,6 +207,9 @@ fun SuperDropdown( val dropdownMaxHeight by rememberUpdatedState(with(density) { (windowHeightPx - statusBarPx - navigationBarPx - captionBarPx ).toDp() }) + val dropdownElevation by rememberUpdatedState(with(density) { + 11.dp.toPx() + }) val insideWidthPx by rememberUpdatedState(with(density) { insideMargin.width.toPx() }.roundToInt()) val insideHeightPx by rememberUpdatedState(with(density) { insideMargin.height.toPx() }.roundToInt()) val displayCutoutLeftSize = rememberUpdatedState(with(density) { @@ -257,10 +260,10 @@ fun SuperDropdown( .heightIn(50.dp, dropdownMaxHeight) .align(AbsoluteAlignment.TopLeft) .graphicsLayer( - shadowElevation = 40f, + shadowElevation = dropdownElevation, shape = SmoothRoundedCornerShape(16.dp), - ambientShadowColor = Color.Black.copy(alpha = 0.2f), - spotShadowColor = Color.Black.copy(alpha = 0.6f) + ambientShadowColor = Color.Black.copy(alpha = 0.3f), + spotShadowColor = Color.Black.copy(alpha = 0.3f) ) .clip(SmoothRoundedCornerShape(16.dp)) .background(MiuixTheme.colorScheme.surface) @@ -307,15 +310,8 @@ fun DropdownImpl( onSelectedIndexChange: (Int) -> Unit, textWidthDp: Dp? ) { - val additionalTopPadding: Dp - val additionalBottomPadding: Dp - if (optionSize == 1) { - additionalTopPadding = 16.dp - additionalBottomPadding = 16.dp - } else { - additionalTopPadding = if (index == 0) 22.5f.dp else 14.5f.dp - additionalBottomPadding = if (index == optionSize - 1) 22.5f.dp else 14.5f.dp - } + val additionalTopPadding = if (index == 0) 20f.dp else 12f.dp + val additionalBottomPadding = if (index == optionSize - 1) 20f.dp else 12f.dp val textColor = if (isSelected) { MiuixTheme.colorScheme.onTertiaryContainer } else { diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/theme/MiuixColor.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/theme/MiuixColor.kt index c820faa1..7a6758f9 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/theme/MiuixColor.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/theme/MiuixColor.kt @@ -251,6 +251,6 @@ fun darkColorScheme() = MiuixColor( onSurfaceContainerHigh = Color(0xFF6C6C6C), surfaceContainerHighest = Color(0xFF2D2D2D), onSurfaceContainerHighest = Color(0xFFE9E9E9), - windowDimming = Color.Black.copy(alpha = 0.3f), + windowDimming = Color.Black.copy(alpha = 0.6f), selectedTint = Color(0xCC393939) ) \ No newline at end of file