From e784705750ab1a168ee7635856bef24ad7454bd4 Mon Sep 17 00:00:00 2001 From: fankesyooni Date: Mon, 27 Nov 2023 05:39:11 +0800 Subject: [PATCH] refactor: use standardization LocalShapes instead CircleShape --- .../kotlin/com/highcapable/flexiui/component/Button.kt | 3 +-- .../kotlin/com/highcapable/flexiui/component/RadioButton.kt | 4 ++-- .../kotlin/com/highcapable/flexiui/component/Slider.kt | 5 ++--- .../kotlin/com/highcapable/flexiui/component/Switch.kt | 3 +-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/Button.kt b/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/Button.kt index f09074c..f1a9ee2 100644 --- a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/Button.kt +++ b/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/Button.kt @@ -31,7 +31,6 @@ import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.RowScope import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.shape.CircleShape import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.Immutable @@ -261,7 +260,7 @@ private fun defaultButtonStyle() = ButtonStyle( @ReadOnlyComposable private fun defaultIconButtonStyle() = ButtonStyle( padding = PaddingValues(), - shape = CircleShape, + shape = LocalShapes.current.tertiary, border = defaultButtonBorder() ) diff --git a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/RadioButton.kt b/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/RadioButton.kt index d60a881..9c5935c 100644 --- a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/RadioButton.kt +++ b/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/RadioButton.kt @@ -35,7 +35,6 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.foundation.shape.CircleShape import androidx.compose.runtime.Composable import androidx.compose.runtime.Immutable import androidx.compose.runtime.ReadOnlyComposable @@ -52,6 +51,7 @@ import androidx.compose.ui.semantics.Role import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import com.highcapable.flexiui.LocalColors +import com.highcapable.flexiui.LocalShapes import com.highcapable.flexiui.LocalSizes import com.highcapable.flexiui.extension.status import com.highcapable.flexiui.interaction.clickable @@ -153,7 +153,7 @@ private fun defaultRadioButtonStyle() = RadioButtonStyle( strokeRadius = DefaultStrokeRadius, pressedGain = DefaultPressedGain, hoveredGain = DefaultHoveredGain, - shape = CircleShape, + shape = LocalShapes.current.tertiary, border = defaultRadioButtonBorder() ) diff --git a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/Slider.kt b/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/Slider.kt index 38c860d..0ca5652 100644 --- a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/Slider.kt +++ b/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/Slider.kt @@ -39,7 +39,6 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width -import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.CornerBasedShape import androidx.compose.runtime.Composable import androidx.compose.runtime.Immutable @@ -258,8 +257,8 @@ private fun defaultSliderStyle() = SliderStyle( thumbRadius = DefaultThumbRadius, thumbGain = DefaultThumbGain, thumbShadowSize = DefaultThumbShadowSize, - thumbShape = CircleShape, - stepShape = CircleShape, + thumbShape = LocalShapes.current.tertiary, + stepShape = LocalShapes.current.tertiary, trackShape = LocalShapes.current.primary, thumbBorder = defaultSliderBorder(), stepBorder = defaultSliderBorder(), diff --git a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/Switch.kt b/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/Switch.kt index 8a92d68..e16e23f 100644 --- a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/Switch.kt +++ b/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/Switch.kt @@ -38,7 +38,6 @@ import androidx.compose.foundation.layout.RowScope import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.foundation.shape.CircleShape import androidx.compose.runtime.Composable import androidx.compose.runtime.Immutable import androidx.compose.runtime.ReadOnlyComposable @@ -220,7 +219,7 @@ private fun defaultSwitchStyle() = SwitchStyle( thumbRadius = DefaultThumbRadius, thumbGain = DefaultThumbGain, thumbShadowSize = DefaultThumbShadowSize, - thumbShape = CircleShape, + thumbShape = LocalShapes.current.tertiary, trackShape = LocalShapes.current.tertiary, thumbBorder = defaultSwitchBorder(), trackBorder = defaultSwitchBorder(),