mirror of
https://github.com/BetterAndroid/FlexiUI.git
synced 2025-09-07 19:14:12 +08:00
refactor: use inner background color in AreaBox, ItemBox
This commit is contained in:
@@ -218,7 +218,10 @@ object AreaBoxDefaults {
|
||||
*/
|
||||
@Composable
|
||||
fun colors(
|
||||
backgroundColor: Color = AreaBoxProperties.BackgroundColor.toColor(),
|
||||
backgroundColor: Color = when (LocalInAreaBox.current) {
|
||||
true -> AreaBoxProperties.InnerBackgroundColor
|
||||
else -> AreaBoxProperties.BackgroundColor
|
||||
}.toColor(),
|
||||
borderColor: Color = AreaBoxProperties.BorderColor.toColor()
|
||||
) = AreaBoxColors(
|
||||
backgroundColor = backgroundColor,
|
||||
@@ -268,6 +271,7 @@ object AreaBoxDefaults {
|
||||
@Stable
|
||||
internal object AreaBoxProperties {
|
||||
val BackgroundColor = ColorsDescriptor.ForegroundPrimary
|
||||
val InnerBackgroundColor = ColorsDescriptor.ForegroundSecondary
|
||||
val BorderColor = ColorsDescriptor.TextPrimary
|
||||
val Padding = PaddingDescriptor(SizesDescriptor.SpacingPrimary)
|
||||
val Shape = ShapesDescriptor.Primary
|
||||
|
@@ -247,7 +247,7 @@ object ItemBoxDefaults {
|
||||
*/
|
||||
@Composable
|
||||
fun colors(
|
||||
backgroundColor: Color = ItemBoxProperties.BackgroundColor.toColor(),
|
||||
backgroundColor: Color = AreaBoxDefaults.colors().backgroundColor,
|
||||
titleTextColor: Color = ItemBoxProperties.TitleTextColor.toColor(),
|
||||
subtitleTextColor: Color = ItemBoxProperties.SubtitleTextColor.toColor(),
|
||||
arrowIconTint: Color = ItemBoxProperties.ArrowIconTint.toColor(),
|
||||
@@ -290,7 +290,6 @@ object ItemBoxDefaults {
|
||||
|
||||
@Stable
|
||||
internal object ItemBoxProperties {
|
||||
val BackgroundColor = AreaBoxProperties.BackgroundColor
|
||||
val TitleTextColor = ColorsDescriptor.TextPrimary
|
||||
val SubtitleTextColor = ColorsDescriptor.TextSecondary
|
||||
val ArrowIconTint = ColorsDescriptor.TextSecondary
|
||||
|
Reference in New Issue
Block a user