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