Shapes moved to defaults object

This commit is contained in:
T8RIN 2025-06-22 20:46:33 +03:00
parent 10f2c0cd50
commit 203ca626d3
298 changed files with 1062 additions and 1192 deletions

View File

@ -24,7 +24,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
@ -41,6 +40,7 @@ import com.t8rin.imagetoolbox.core.resources.icons.ImageToolboxBroken
import com.t8rin.imagetoolbox.core.settings.presentation.provider.LocalSettingsState
import com.t8rin.imagetoolbox.core.ui.theme.blend
import com.t8rin.imagetoolbox.core.ui.theme.takeColorFromScheme
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
@Composable
@ -51,7 +51,7 @@ internal fun CrashAttentionCard() {
modifier = Modifier
.fillMaxWidth()
.container(
shape = RoundedCornerShape(size = 20.dp),
shape = ShapeDefaults.large,
resultPadding = 16.dp,
color = takeColorFromScheme {
if (isNightMode) {

View File

@ -20,7 +20,6 @@ package com.t8rin.imagetoolbox.core.crash.presentation.components
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.BugReport
@ -31,13 +30,14 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.other.ExpandableItem
import com.t8rin.imagetoolbox.core.ui.widget.text.AutoSizeText
@Composable
internal fun CrashInfoCard(crashInfo: CrashInfo) {
ExpandableItem(
shape = RoundedCornerShape(24.dp),
shape = ShapeDefaults.extraLarge,
modifier = Modifier.fillMaxWidth(),
visibleContent = {
Icon(

View File

@ -59,4 +59,6 @@ suspend inline fun <T, R> T.runSuspendCatching(block: T.() -> R): Result<R> {
}
}
inline fun <T : Any> KClass<T>.simpleName() = simpleName!!
inline fun <T : Any> KClass<T>.simpleName() = simpleName!!
inline fun <T> Boolean.then(value: T): T? = if (this) value else null

View File

@ -33,7 +33,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.VisibilityOff
@ -72,7 +71,7 @@ import com.t8rin.imagetoolbox.core.ui.theme.outlineVariant
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedDropdownMenu
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.animateContentSizeNoClip
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.fadingEdges
@ -166,7 +165,7 @@ fun <T> FilterItem(
EnhancedDropdownMenu(
expanded = showPopup,
onDismissRequest = { showPopup = false },
shape = RoundedCornerShape(20.dp)
shape = ShapeDefaults.large
) {
Column(
modifier = Modifier
@ -179,7 +178,7 @@ fun <T> FilterItem(
onRemove()
showPopup = false
},
shape = ContainerShapeDefaults.topShape,
shape = ShapeDefaults.top,
containerColor = MaterialTheme.colorScheme.secondary
) {
Icon(
@ -198,8 +197,8 @@ fun <T> FilterItem(
showPopup = false
},
shape = onCreateTemplate?.let {
ContainerShapeDefaults.centerShape
} ?: ContainerShapeDefaults.bottomShape,
ShapeDefaults.center
} ?: ShapeDefaults.bottom,
containerColor = MaterialTheme.colorScheme.primary
) {
Icon(
@ -226,7 +225,7 @@ fun <T> FilterItem(
onCreateTemplate()
showPopup = false
},
shape = ContainerShapeDefaults.bottomShape,
shape = ShapeDefaults.bottom,
containerColor = MaterialTheme.colorScheme.tertiary
) {
Icon(

View File

@ -35,7 +35,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Close
import androidx.compose.material.icons.rounded.Done
@ -68,6 +67,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedTopAppBarDefaults
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedTopAppBarType
import com.t8rin.imagetoolbox.core.ui.widget.image.SimplePicture
import com.t8rin.imagetoolbox.core.ui.widget.image.imageStickyHeader
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.shimmer
import com.t8rin.imagetoolbox.core.ui.widget.text.marquee
@ -174,7 +174,7 @@ internal fun FilterPreviewSheet(
.aspectRatio(
previewBitmap?.safeAspectRatio ?: (1 / 2f)
)
.clip(RoundedCornerShape(8.dp))
.clip(ShapeDefaults.mini)
.shimmer(true)
} else Modifier
)

View File

@ -41,7 +41,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.longPress
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.press
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.text.AutoSizeText
import com.t8rin.imagetoolbox.core.ui.widget.text.TitleItem
import sh.calvin.reorderable.ReorderableItem
@ -102,7 +102,7 @@ fun FilterReorderSheet(
else 1f
).value
),
shape = ContainerShapeDefaults.shapeForIndex(
shape = ShapeDefaults.byIndex(
index = index,
size = data.value.size
),

View File

@ -91,7 +91,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.image.Picture
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceItemOverload
import com.t8rin.imagetoolbox.core.ui.widget.text.AutoSizeText
@ -352,7 +352,7 @@ internal fun FilterSelectionCubeLutBottomContent(
UiCubeLutFilter(1f to FileModel(uri))
)
},
shape = ContainerShapeDefaults.shapeForIndex(
shape = ShapeDefaults.byIndex(
index = index,
size = data.size
),

View File

@ -37,7 +37,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.rounded.ArrowBack
@ -91,8 +90,11 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.image.ImageHeaderState
import com.t8rin.imagetoolbox.core.ui.widget.image.SimplePicture
import com.t8rin.imagetoolbox.core.ui.widget.image.imageStickyHeader
import com.t8rin.imagetoolbox.core.ui.widget.modifier.CornerSides
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.drawHorizontalStroke
import com.t8rin.imagetoolbox.core.ui.widget.modifier.only
import com.t8rin.imagetoolbox.core.ui.widget.modifier.shimmer
import com.t8rin.imagetoolbox.core.ui.widget.other.LocalToastHostState
import com.t8rin.imagetoolbox.core.ui.widget.other.showFailureToast
@ -206,10 +208,7 @@ fun FilterTemplateCreationSheet(
modifier = Modifier
.fillMaxSize()
.clip(
if (isPortrait) RoundedCornerShape(
bottomStart = 24.dp,
bottomEnd = 24.dp
)
if (isPortrait) ShapeDefaults.extraLarge.only(CornerSides.Bottom)
else RectangleShape
)
.background(
@ -267,7 +266,7 @@ fun FilterTemplateCreationSheet(
value = selectedUri ?: previewModel.data,
onValueChange = { selectedUri = it },
subtitle = stringResource(id = R.string.select_template_preview),
shape = RoundedCornerShape(16.dp),
shape = ShapeDefaults.default,
color = Color.Unspecified
)
Spacer(Modifier.height(8.dp))

View File

@ -35,7 +35,6 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.sizeIn
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.AutoFixHigh
import androidx.compose.material.icons.outlined.Delete
@ -83,7 +82,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.image.Picture
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.shimmer
import com.t8rin.imagetoolbox.core.ui.widget.modifier.transparencyChecker
import com.t8rin.imagetoolbox.core.ui.widget.other.QrCode
@ -166,7 +165,7 @@ internal fun FilterTemplateInfoSheet(
modifier = Modifier
.background(
color = MaterialTheme.colorScheme.surfaceContainerLowest,
shape = RoundedCornerShape(16.dp)
shape = ShapeDefaults.default
)
.padding(16.dp)
) {
@ -318,7 +317,7 @@ internal fun FilterTemplateInfoSheet(
) {
PreferenceItem(
title = stringResource(R.string.as_qr_code),
shape = ContainerShapeDefaults.topShape,
shape = ShapeDefaults.top,
startIcon = Icons.Rounded.QrCode,
onClick = {
showShareDialog = false
@ -334,7 +333,7 @@ internal fun FilterTemplateInfoSheet(
Spacer(Modifier.height(4.dp))
PreferenceItem(
title = stringResource(R.string.as_file),
shape = ContainerShapeDefaults.centerShape,
shape = ShapeDefaults.center,
startIcon = Icons.Rounded.FilePresent,
onClick = {
showShareDialog = false
@ -345,7 +344,7 @@ internal fun FilterTemplateInfoSheet(
Spacer(Modifier.height(4.dp))
PreferenceItem(
title = stringResource(R.string.save_as_qr_code_image),
shape = ContainerShapeDefaults.centerShape,
shape = ShapeDefaults.center,
startIcon = Icons.Rounded.QrCode2,
onClick = {
showShareDialog = false
@ -361,7 +360,7 @@ internal fun FilterTemplateInfoSheet(
Spacer(Modifier.height(4.dp))
PreferenceItem(
title = stringResource(R.string.save_as_file),
shape = ContainerShapeDefaults.bottomShape,
shape = ShapeDefaults.bottom,
startIcon = Icons.Rounded.Save,
onClick = {
saveLauncher.make(onRequestTemplateFilename())

View File

@ -105,7 +105,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalSheetDragHandle
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.animateContentSizeNoClip
import com.t8rin.imagetoolbox.core.ui.widget.modifier.shapeByInteraction
import com.t8rin.imagetoolbox.core.ui.widget.text.AutoSizeText
@ -249,7 +249,7 @@ fun AddFiltersSheet(
val interactionSource = remember { MutableInteractionSource() }
val shape = shapeByInteraction(
shape = RoundedCornerShape(42.dp),
pressedShape = RoundedCornerShape(16.dp),
pressedShape = ShapeDefaults.default,
interactionSource = interactionSource
)
@ -326,7 +326,7 @@ fun AddFiltersSheet(
onFilterPicked(filter)
},
onRequestFilterMapping = onRequestFilterMapping,
shape = ContainerShapeDefaults.shapeForIndex(
shape = ShapeDefaults.byIndex(
index = index,
size = filtersForSearch.size
),

View File

@ -57,7 +57,7 @@ import com.t8rin.imagetoolbox.core.resources.icons.BookmarkOff
import com.t8rin.imagetoolbox.core.ui.utils.provider.rememberLocalEssentials
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.longPress
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.press
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import sh.calvin.reorderable.ReorderableItem
import sh.calvin.reorderable.rememberReorderableLazyListState
@ -161,7 +161,7 @@ internal fun FavoritesContent(
}
},
onRequestFilterMapping = onRequestFilterMapping,
shape = ContainerShapeDefaults.shapeForIndex(
shape = ShapeDefaults.byIndex(
index = index,
size = favoriteFilters.size
),

View File

@ -67,7 +67,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.dialogs.OneTimeSaveLocationSelectio
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.image.Picture
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceItemOverload
import com.t8rin.imagetoolbox.core.ui.widget.text.AutoSizeText
@ -114,7 +114,7 @@ internal fun OtherContent(
modifier = Modifier
.weight(1f)
.fillMaxHeight(),
shape = ContainerShapeDefaults.leftShape
shape = ShapeDefaults.start
)
Column(
modifier = Modifier
@ -124,9 +124,9 @@ internal fun OtherContent(
) {
repeat(2) { index ->
val shape = if (index == 0) {
ContainerShapeDefaults.topRightShape
ShapeDefaults.topEnd
} else {
ContainerShapeDefaults.bottomRightShape
ShapeDefaults.bottomEnd
}
val containerColor by animateColorAsState(
if (previewModel.data == R.drawable.filter_preview_source && index == 0) {
@ -171,7 +171,7 @@ internal fun OtherContent(
PreferenceItemOverload(
title = stringResource(R.string.save_empty_lut),
subtitle = stringResource(R.string.save_empty_lut_sub),
shape = ContainerShapeDefaults.defaultShape,
shape = ShapeDefaults.default,
modifier = Modifier
.fillMaxWidth()
.padding(bottom = 8.dp),
@ -258,7 +258,7 @@ internal fun OtherContent(
}
},
onRequestFilterMapping = onRequestFilterMapping,
shape = ContainerShapeDefaults.shapeForIndex(
shape = ShapeDefaults.byIndex(
index = index,
size = filters.size
),

View File

@ -54,7 +54,7 @@ import com.t8rin.imagetoolbox.core.filters.presentation.widget.FilterTemplateInf
import com.t8rin.imagetoolbox.core.filters.presentation.widget.TemplateFilterSelectionItem
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.utils.provider.rememberLocalEssentials
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.utils.rememberForeverLazyListState
@Composable
@ -129,7 +129,7 @@ internal fun TemplatesContent(
showFilterTemplateInfoSheet = true
},
onRequestFilterMapping = onRequestFilterMapping,
shape = ContainerShapeDefaults.shapeForIndex(
shape = ShapeDefaults.byIndex(
index = index,
size = templateFilters.size
),

View File

@ -92,7 +92,7 @@ internal fun ToneCurvesParamsItem(
},
imageObtainingTrigger = false,
onImageObtained = { },
//shape = RoundedCornerShape(4.dp),
//shape = ShapeDefaults.extraSmall,
containerModifier = Modifier.fillMaxWidth(),
onStateChange = {
onFilterChange(

View File

@ -43,7 +43,7 @@ import com.t8rin.imagetoolbox.core.ui.utils.helper.toImageModel
import com.t8rin.imagetoolbox.core.ui.widget.controls.selection.ImageSelector
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButtonGroup
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedSliderItem
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
@Composable
@ -90,7 +90,7 @@ internal fun FloatPaletteImageModelTripleItem(
modifier = Modifier
.padding(horizontal = 16.dp)
.container(
shape = ContainerShapeDefaults.topShape,
shape = ShapeDefaults.top,
color = MaterialTheme.colorScheme.surfaceContainerLow
)
) {
@ -143,7 +143,7 @@ internal fun FloatPaletteImageModelTripleItem(
)
},
subtitle = null,
shape = ContainerShapeDefaults.bottomShape
shape = ShapeDefaults.bottom
)
Spacer(Modifier.height(16.dp))
}

View File

@ -44,7 +44,7 @@ import com.t8rin.imagetoolbox.core.resources.icons.MiniEdit
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedAlertDialog
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.fadingEdges
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceItem
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceItemDefaults
@ -110,7 +110,7 @@ fun ShareButton(
) {
PreferenceItem(
title = stringResource(R.string.share),
shape = ContainerShapeDefaults.topShape,
shape = ShapeDefaults.top,
startIcon = Icons.Rounded.Share,
onClick = {
showSelectionDialog = false
@ -122,8 +122,8 @@ fun ShareButton(
Spacer(Modifier.height(4.dp))
PreferenceItem(
title = stringResource(R.string.copy),
shape = if (onEdit == null) ContainerShapeDefaults.bottomShape
else ContainerShapeDefaults.centerShape,
shape = if (onEdit == null) ShapeDefaults.bottom
else ShapeDefaults.center,
startIcon = Icons.Rounded.ContentCopy,
onClick = {
showSelectionDialog = false
@ -136,7 +136,7 @@ fun ShareButton(
Spacer(Modifier.height(4.dp))
PreferenceItem(
title = stringResource(R.string.edit),
shape = ContainerShapeDefaults.bottomShape,
shape = ShapeDefaults.bottom,
startIcon = Icons.Rounded.MiniEdit,
onClick = {
showSelectionDialog = false

View File

@ -24,7 +24,7 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.PressInteraction
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.History
import androidx.compose.material3.Icon
@ -40,6 +40,7 @@ import androidx.compose.ui.platform.LocalHapticFeedback
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.shapeByInteraction
@Composable
@ -51,8 +52,8 @@ fun ShowOriginalButton(
val interactionSource = remember { MutableInteractionSource() }
val shape = shapeByInteraction(
shape = RoundedCornerShape(100),
pressedShape = RoundedCornerShape(8.dp),
shape = CircleShape,
pressedShape = ShapeDefaults.mini,
interactionSource = interactionSource
)

View File

@ -22,7 +22,6 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Info
import androidx.compose.material3.Icon
@ -39,6 +38,7 @@ import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.shapeByInteraction
@Composable
@ -52,7 +52,7 @@ fun SupportingButton(
val interactionSource = remember { MutableInteractionSource() }
val shape = shapeByInteraction(
shape = IconButtonDefaults.smallRoundShape,
pressedShape = RoundedCornerShape(4.dp),
pressedShape = ShapeDefaults.extraSmall,
interactionSource = interactionSource
)

View File

@ -24,7 +24,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
@ -41,6 +40,7 @@ import com.smarttoolfactory.colorpicker.selector.SelectorRectSaturationValueHSV
import com.smarttoolfactory.colorpicker.slider.SliderAlphaHSL
import com.smarttoolfactory.colorpicker.slider.SliderHueHSV
import com.t8rin.imagetoolbox.core.settings.presentation.provider.LocalSettingsState
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
@Composable
@ -68,10 +68,10 @@ fun AlphaColorSelection(
.fillMaxWidth()
.aspectRatio(4 / 3f)
.container(
RoundedCornerShape(size = 6.dp),
shape = ShapeDefaults.pressed,
resultPadding = 0.dp
)
.clip(RoundedCornerShape(6.dp)),
.clip(ShapeDefaults.pressed),
hue = hue,
saturation = saturation,
value = value

View File

@ -39,7 +39,6 @@ import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.items
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Delete
@ -90,7 +89,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalSheetDragHandle
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedSliderItem
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.palette_selection.PaletteStyleSelection
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceRowSwitch
@ -251,7 +250,7 @@ fun AvailableColorTuplesSheet(
val palette = @Composable {
PaletteStyleSelection(
onThemeStyleSelected = onThemeStyleSelected,
shape = ContainerShapeDefaults.topShape,
shape = ShapeDefaults.top,
)
}
val invertColors = @Composable {
@ -261,7 +260,7 @@ fun AvailableColorTuplesSheet(
checked = settingsState.isInvertThemeColors,
modifier = Modifier,
startIcon = Icons.Rounded.InvertColors,
shape = ContainerShapeDefaults.centerShape,
shape = ShapeDefaults.center,
onClick = { onToggleInvertColors() }
)
}
@ -272,7 +271,7 @@ fun AvailableColorTuplesSheet(
checked = settingsState.useEmojiAsPrimaryColor,
modifier = Modifier,
startIcon = Icons.Outlined.EmojiEmotions,
shape = ContainerShapeDefaults.centerShape,
shape = ShapeDefaults.center,
onClick = { onToggleUseEmojiAsPrimaryColor() }
)
}
@ -282,7 +281,7 @@ fun AvailableColorTuplesSheet(
icon = Icons.Rounded.Contrast,
title = stringResource(id = R.string.contrast),
valueRange = -1f..1f,
shape = ContainerShapeDefaults.bottomShape,
shape = ShapeDefaults.bottom,
onValueChange = { },
internalStateTransformation = {
it.roundToTwoDigits()
@ -308,7 +307,7 @@ fun AvailableColorTuplesSheet(
Column(
modifier = Modifier
.padding(bottom = 16.dp)
.container(RoundedCornerShape(24.dp))
.container(ShapeDefaults.extraLarge)
) {
Row(
modifier = Modifier.fillMaxWidth(),

View File

@ -31,7 +31,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Palette
import androidx.compose.material.icons.rounded.ContentCopy
@ -76,6 +75,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedAlertDialog
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.transparencyChecker
import com.t8rin.imagetoolbox.core.ui.widget.text.AutoSizeText
@ -153,7 +153,7 @@ fun ColorInfo(
.size(28.dp)
.background(
color = Color(color).copy(alpha = 1f),
shape = RoundedCornerShape(8.dp)
shape = ShapeDefaults.mini
)
.padding(2.dp)
)
@ -200,7 +200,7 @@ fun ColorInfo(
style = MaterialTheme.typography.titleMedium,
maxLines = 1,
modifier = Modifier
.clip(RoundedCornerShape(6.dp))
.clip(ShapeDefaults.pressed)
.hapticsClickable {
expanded = true
}
@ -271,7 +271,7 @@ fun ColorInfo(
val style =
MaterialTheme.typography.titleMedium.copy(textAlign = TextAlign.Center)
OutlinedTextField(
shape = RoundedCornerShape(16.dp),
shape = ShapeDefaults.default,
textStyle = style,
maxLines = 1,
value = value.removePrefix("#"),

View File

@ -24,7 +24,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
@ -40,6 +39,7 @@ import com.smarttoolfactory.colordetector.util.ColorUtil
import com.smarttoolfactory.colorpicker.selector.SelectorRectSaturationValueHSV
import com.smarttoolfactory.colorpicker.slider.SliderHueHSV
import com.t8rin.imagetoolbox.core.settings.presentation.provider.LocalSettingsState
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
@Composable
@ -66,11 +66,11 @@ fun ColorSelection(
.fillMaxWidth()
.aspectRatio(4 / 2.5f)
.container(
shape = RoundedCornerShape(6.dp),
shape = ShapeDefaults.pressed,
resultPadding = 0.dp,
color = infoContainerColor
)
.clip(RoundedCornerShape(6.dp)),
.clip(ShapeDefaults.pressed),
hue = hue,
saturation = saturation,
value = value

View File

@ -61,6 +61,7 @@ import com.t8rin.imagetoolbox.core.ui.utils.provider.LocalContainerColor
import com.t8rin.imagetoolbox.core.ui.utils.provider.ProvideContainerDefaults
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsCombinedClickable
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.animateShape
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.fadingEdges
@ -121,7 +122,7 @@ fun ColorSelectionRow(
val background = customColor ?: MaterialTheme.colorScheme.primary
val isSelected = customColor != null
val shape = animateShape(
if (isSelected) RoundedCornerShape(8.dp)
if (isSelected) ShapeDefaults.mini
else RoundedCornerShape(itemSize / 2)
)
@ -206,7 +207,7 @@ fun ColorSelectionRow(
) { color ->
val isSelected = value == color && customColor == null
val shape = animateShape(
if (isSelected) RoundedCornerShape(8.dp)
if (isSelected) ShapeDefaults.mini
else RoundedCornerShape(itemSize / 2)
)

View File

@ -28,7 +28,6 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.GridItemSpan
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Palette
import androidx.compose.material.icons.rounded.ContentPaste
@ -59,6 +58,7 @@ import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.settings.presentation.provider.LocalSettingsState
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.text.AutoSizeText
import com.t8rin.imagetoolbox.core.ui.widget.text.TitleItem
@ -154,7 +154,7 @@ fun ColorTuplePicker(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center,
modifier = Modifier
.container(RoundedCornerShape(24.dp))
.container(ShapeDefaults.extraLarge)
.padding(16.dp)
) {
Icon(
@ -197,7 +197,7 @@ fun ColorTuplePicker(
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
.container(RoundedCornerShape(24.dp))
.container(ShapeDefaults.extraLarge)
.padding(horizontal = 20.dp)
) {
TitleItem(text = stringResource(R.string.primary))
@ -220,7 +220,7 @@ fun ColorTuplePicker(
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
.container(RoundedCornerShape(24.dp))
.container(ShapeDefaults.extraLarge)
.padding(horizontal = 20.dp)
) {
TitleItem(text = stringResource(R.string.secondary))
@ -237,7 +237,7 @@ fun ColorTuplePicker(
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
.container(RoundedCornerShape(24.dp))
.container(ShapeDefaults.extraLarge)
.padding(horizontal = 20.dp)
) {
TitleItem(text = stringResource(R.string.tertiary))
@ -254,7 +254,7 @@ fun ColorTuplePicker(
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
.container(RoundedCornerShape(24.dp))
.container(ShapeDefaults.extraLarge)
.padding(horizontal = 20.dp)
) {
TitleItem(text = stringResource(R.string.surface))

View File

@ -33,7 +33,6 @@ import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.History
import androidx.compose.material.icons.rounded.BookmarkBorder
@ -69,6 +68,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.longPress
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.press
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.fadingEdges
import com.t8rin.imagetoolbox.core.ui.widget.modifier.transparencyChecker
@ -99,7 +99,7 @@ fun RecentAndFavoriteColorsCard(
modifier = Modifier
.padding(bottom = 16.dp)
.container(
shape = RoundedCornerShape(24.dp),
shape = ShapeDefaults.extraLarge,
resultPadding = 0.dp
)
.padding(16.dp),

View File

@ -24,7 +24,6 @@ import androidx.compose.animation.fadeOut
import androidx.compose.animation.shrinkVertically
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@ -36,6 +35,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.t8rin.imagetoolbox.core.domain.image.model.ImageFormat
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
@Composable
@ -55,7 +55,7 @@ fun FormatExifWarning(
alpha = 0.7f
),
resultPadding = 0.dp,
shape = RoundedCornerShape(16.dp)
shape = ShapeDefaults.default
)
) {
Text(

View File

@ -24,7 +24,6 @@ import androidx.compose.animation.fadeOut
import androidx.compose.animation.shrinkVertically
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@ -35,6 +34,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
@Composable
@ -54,7 +54,7 @@ fun IcoSizeWarning(visible: Boolean) {
alpha = 0.7f
),
resultPadding = 4.dp,
shape = RoundedCornerShape(16.dp)
shape = ShapeDefaults.default
)
) {
Text(

View File

@ -39,7 +39,6 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Add
import androidx.compose.material3.Icon
@ -75,7 +74,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.longPress
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.press
import com.t8rin.imagetoolbox.core.ui.widget.image.ImagePager
import com.t8rin.imagetoolbox.core.ui.widget.image.Picture
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.animateContentSizeNoClip
import com.t8rin.imagetoolbox.core.ui.widget.modifier.animateShape
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
@ -92,7 +91,7 @@ fun ImageReorderCarousel(
images: List<Uri>?,
onReorder: (List<Uri>) -> Unit,
modifier: Modifier = Modifier
.container(RoundedCornerShape(24.dp)),
.container(ShapeDefaults.extraLarge),
onNeedToAddImage: () -> Unit,
onNeedToRemoveImageAt: (Int) -> Unit,
onNavigate: (Screen) -> Unit
@ -198,8 +197,8 @@ fun ImageReorderCarousel(
) { isDragging ->
val alpha by animateFloatAsState(if (isDragging) 0.3f else 0.6f)
val shape = animateShape(
if (showButton) ContainerShapeDefaults.topShape
else ContainerShapeDefaults.defaultShape
if (showButton) ShapeDefaults.top
else ShapeDefaults.default
)
Column(
@ -266,7 +265,7 @@ fun ImageReorderCarousel(
0.5f
),
contentColor = MaterialTheme.colorScheme.onSecondaryContainer,
shape = ContainerShapeDefaults.bottomShape,
shape = ShapeDefaults.bottom,
modifier = Modifier
.padding(top = 4.dp)
.height(30.dp)

View File

@ -24,7 +24,6 @@ import androidx.compose.animation.fadeOut
import androidx.compose.animation.shrinkVertically
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@ -35,6 +34,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
@Composable
@ -54,7 +54,7 @@ fun OOMWarning(visible: Boolean) {
alpha = 0.7f
),
resultPadding = 0.dp,
shape = RoundedCornerShape(16.dp)
shape = ShapeDefaults.default
)
) {
Text(

View File

@ -30,7 +30,6 @@ import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Calculate
@ -54,7 +53,7 @@ import com.t8rin.imagetoolbox.core.ui.utils.helper.ImageUtils
import com.t8rin.imagetoolbox.core.ui.utils.helper.ImageUtils.restrict
import com.t8rin.imagetoolbox.core.ui.widget.dialogs.CalculatorDialog
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.animateContentSizeNoClip
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.text.AutoSizeText
@ -70,7 +69,7 @@ fun ResizeImageField(
) {
Column(
modifier = Modifier
.container(shape = RoundedCornerShape(24.dp))
.container(shape = ShapeDefaults.extraLarge)
.padding(8.dp)
.animateContentSizeNoClip()
) {
@ -91,7 +90,7 @@ fun ResizeImageField(
.toIntOrNull() ?: 0
)
},
shape = ContainerShapeDefaults.smallLeftShape,
shape = ShapeDefaults.smallStart,
label = {
AutoSizeText(
stringResource(
@ -119,7 +118,7 @@ fun ResizeImageField(
.toIntOrNull() ?: 0
)
},
shape = ContainerShapeDefaults.smallRightShape,
shape = ShapeDefaults.smallEnd,
label = {
AutoSizeText(
stringResource(

View File

@ -17,18 +17,17 @@
package com.t8rin.imagetoolbox.core.ui.widget.controls
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.domain.image.model.ImageFormat
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.resources.icons.Exif
import com.t8rin.imagetoolbox.core.settings.presentation.provider.LocalSettingsState
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceRowSwitch
@Composable
@ -56,7 +55,7 @@ fun SaveExifWidget(
},
checked = checked,
enabled = imageFormat.canWriteExif,
shape = RoundedCornerShape(24.dp),
shape = ShapeDefaults.extraLarge,
color = backgroundColor,
onClick = onCheckedChange,
startIcon = Icons.Rounded.Exif

View File

@ -17,15 +17,14 @@
package com.t8rin.imagetoolbox.core.ui.widget.controls
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.LinearScale
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceRowSwitch
@Composable
@ -40,7 +39,7 @@ fun ScaleSmallImagesToLargeToggle(
subtitle = stringResource(R.string.scale_small_images_to_large_sub),
checked = checked,
color = Color.Unspecified,
shape = RoundedCornerShape(24.dp),
shape = ShapeDefaults.extraLarge,
onClick = onCheckedChange,
startIcon = Icons.Rounded.LinearScale
)

View File

@ -45,7 +45,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.text.TitleItem
@ -110,7 +110,7 @@ fun SortButton(
modifier = Modifier
.fillMaxWidth()
.container(
shape = ContainerShapeDefaults.shapeForIndex(
shape = ShapeDefaults.byIndex(
index = index,
size = items.size
),

View File

@ -32,7 +32,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
@ -66,7 +65,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.controls.selection.PositionSelector
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButtonGroup
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.animateContentSizeNoClip
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.saver.ColorSaver
@ -135,7 +134,7 @@ fun ResizeTypeSelector(
Column(
modifier = modifier
.container(shape = RoundedCornerShape(24.dp))
.container(shape = ShapeDefaults.extraLarge)
.animateContentSizeNoClip(),
horizontalAlignment = Alignment.CenterHorizontally
) {
@ -203,7 +202,7 @@ fun ResizeTypeSelector(
.fillMaxWidth()
.padding(8.dp)
.container(
shape = RoundedCornerShape(16.dp),
shape = ShapeDefaults.default,
color = MaterialTheme.colorScheme.surface
),
itemCount = entries.size,
@ -243,7 +242,7 @@ fun ResizeTypeSelector(
position = it
updateCropResizeType()
},
shape = ContainerShapeDefaults.topShape,
shape = ShapeDefaults.top,
color = MaterialTheme.colorScheme.surface
)
Spacer(modifier = Modifier.height(4.dp))
@ -253,7 +252,7 @@ fun ResizeTypeSelector(
useBlurredBgInsteadOfColor = it
updateCropResizeType()
},
shape = ContainerShapeDefaults.centerShape
shape = ShapeDefaults.center
)
Spacer(modifier = Modifier.height(4.dp))
AnimatedContent(targetState = useBlurredBgInsteadOfColor) { showBlurRadius ->
@ -266,13 +265,13 @@ fun ResizeTypeSelector(
blurRadius = it
updateCropResizeType()
},
shape = ContainerShapeDefaults.bottomShape
shape = ShapeDefaults.bottom
)
} else {
ColorRowSelector(
modifier = Modifier
.container(
shape = ContainerShapeDefaults.bottomShape,
shape = ShapeDefaults.bottom,
color = MaterialTheme.colorScheme.surface
),
value = canvasColor,
@ -299,7 +298,7 @@ fun ResizeTypeSelector(
position = it
updateFitResizeType()
},
shape = ContainerShapeDefaults.topShape,
shape = ShapeDefaults.top,
color = MaterialTheme.colorScheme.surface
)
Spacer(modifier = Modifier.height(4.dp))
@ -309,7 +308,7 @@ fun ResizeTypeSelector(
useBlurredBgInsteadOfColor = it
updateFitResizeType()
},
shape = ContainerShapeDefaults.centerShape
shape = ShapeDefaults.center
)
Spacer(modifier = Modifier.height(4.dp))
AnimatedContent(targetState = useBlurredBgInsteadOfColor) { showBlurRadius ->
@ -322,13 +321,13 @@ fun ResizeTypeSelector(
blurRadius = it
updateFitResizeType()
},
shape = ContainerShapeDefaults.bottomShape
shape = ShapeDefaults.bottom
)
} else {
ColorRowSelector(
modifier = Modifier
.container(
shape = ContainerShapeDefaults.bottomShape,
shape = ShapeDefaults.bottom,
color = MaterialTheme.colorScheme.surface
),
value = canvasColor,
@ -356,7 +355,7 @@ fun ResizeTypeSelector(
Modifier
.fillMaxWidth()
.container(
shape = ContainerShapeDefaults.shapeForIndex(
shape = ShapeDefaults.byIndex(
index = index,
size = ResizeType.entries.size
),

View File

@ -18,7 +18,6 @@
package com.t8rin.imagetoolbox.core.ui.widget.controls.resize_group.components
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.BlurCircular
import androidx.compose.material3.MaterialTheme
@ -30,6 +29,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedSliderItem
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import kotlin.math.roundToInt
@Composable
@ -39,7 +39,7 @@ fun BlurRadiusSelector(
color: Color = MaterialTheme.colorScheme.surfaceContainer,
valueRange: ClosedFloatingPointRange<Float> = 5f..100f,
onValueChange: (Int) -> Unit,
shape: Shape = RoundedCornerShape(16.dp)
shape: Shape = ShapeDefaults.default
) {
EnhancedSliderItem(
modifier = modifier,

View File

@ -17,7 +17,6 @@
package com.t8rin.imagetoolbox.core.ui.widget.controls.resize_group.components
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.BlurLinear
import androidx.compose.material3.MaterialTheme
@ -25,8 +24,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceRowSwitch
@Composable
@ -34,7 +33,7 @@ fun UseBlurredBackgroundToggle(
modifier: Modifier = Modifier,
checked: Boolean,
onCheckedChange: (Boolean) -> Unit,
shape: Shape = RoundedCornerShape(16.dp)
shape: Shape = ShapeDefaults.default
) {
PreferenceRowSwitch(
modifier = modifier,

View File

@ -18,7 +18,6 @@
package com.t8rin.imagetoolbox.core.ui.widget.controls.selection
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Opacity
import androidx.compose.runtime.Composable
@ -31,6 +30,7 @@ import androidx.compose.ui.unit.dp
import com.smarttoolfactory.colordetector.util.ColorUtil.roundToTwoDigits
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedSliderItem
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
@Composable
fun AlphaSelector(
@ -38,7 +38,7 @@ fun AlphaSelector(
onValueChange: (Float) -> Unit,
modifier: Modifier = Modifier,
color: Color = Color.Unspecified,
shape: Shape = RoundedCornerShape(24.dp),
shape: Shape = ShapeDefaults.extraLarge,
title: String = stringResource(R.string.paint_alpha),
icon: ImageVector = Icons.Rounded.Opacity
) {

View File

@ -17,7 +17,6 @@
package com.t8rin.imagetoolbox.core.ui.widget.controls.selection
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Layers
import androidx.compose.material3.MaterialTheme
@ -27,10 +26,10 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.domain.image.model.BlendingMode
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.utils.helper.entries
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
@Composable
fun BlendingModeSelector(
@ -52,7 +51,7 @@ fun BlendingModeSelector(
}
},
modifier: Modifier = Modifier,
shape: Shape = RoundedCornerShape(20.dp),
shape: Shape = ShapeDefaults.large,
color: Color = MaterialTheme.colorScheme.surface
) {
DataSelector(

View File

@ -31,7 +31,6 @@ import androidx.compose.foundation.lazy.staggeredgrid.LazyHorizontalStaggeredGri
import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCells
import androidx.compose.foundation.lazy.staggeredgrid.items
import androidx.compose.foundation.lazy.staggeredgrid.rememberLazyStaggeredGridState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.KeyboardArrowDown
import androidx.compose.material3.Badge
@ -57,6 +56,7 @@ import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.ui.utils.confetti.LocalConfettiHostState
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedChip
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.fadingEdges
import com.t8rin.imagetoolbox.core.ui.widget.modifier.scaleOnTap
@ -75,12 +75,12 @@ fun <T : Any> DataSelector(
spanCount: Int = 3,
modifier: Modifier = Modifier,
badgeContent: (@Composable RowScope.() -> Unit)? = null,
shape: Shape = RoundedCornerShape(20.dp),
shape: Shape = ShapeDefaults.large,
color: Color = Color.Unspecified,
selectedItemColor: Color = MaterialTheme.colorScheme.tertiary,
initialExpanded: Boolean = false
) {
val spanCount = spanCount.coerceAtLeast(1)
val realSpanCount = spanCount.coerceAtLeast(1)
Column(
modifier = modifier.container(
@ -88,9 +88,9 @@ fun <T : Any> DataSelector(
color = color
)
) {
var expanded by rememberSaveable(initialExpanded, spanCount) {
var expanded by rememberSaveable(initialExpanded, realSpanCount) {
mutableStateOf(
initialExpanded && spanCount > 1
initialExpanded && realSpanCount > 1
)
}
Row {
@ -128,7 +128,7 @@ fun <T : Any> DataSelector(
}
}
if (spanCount > 1) {
if (realSpanCount > 1) {
EnhancedIconButton(
containerColor = Color.Transparent,
onClick = { expanded = !expanded }
@ -163,14 +163,14 @@ fun <T : Any> DataSelector(
.heightIn(
max = animateDpAsState(
if (expanded) {
52.dp * spanCount - 8.dp * (spanCount - 1)
52.dp * realSpanCount - 8.dp * (realSpanCount - 1)
} else 52.dp
).value
)
.fadingEdges(
scrollableState = state,
isVertical = false,
spanCount = spanCount
spanCount = realSpanCount
),
contentPadding = PaddingValues(8.dp)
) {

View File

@ -31,7 +31,6 @@ import androidx.compose.foundation.lazy.staggeredgrid.LazyHorizontalStaggeredGri
import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCells
import androidx.compose.foundation.lazy.staggeredgrid.items
import androidx.compose.foundation.lazy.staggeredgrid.rememberLazyStaggeredGridState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.TextFields
import androidx.compose.material.icons.rounded.KeyboardArrowDown
@ -58,6 +57,7 @@ import com.t8rin.imagetoolbox.core.ui.theme.Typography
import com.t8rin.imagetoolbox.core.ui.utils.confetti.LocalConfettiHostState
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedChip
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.fadingEdges
import com.t8rin.imagetoolbox.core.ui.widget.modifier.scaleOnTap
@ -72,7 +72,7 @@ fun FontSelector(
modifier: Modifier = Modifier,
title: String = stringResource(R.string.font),
color: Color = MaterialTheme.colorScheme.surface,
shape: Shape = RoundedCornerShape(20.dp)
shape: Shape = ShapeDefaults.large
) {
Column(
modifier = modifier.container(

View File

@ -24,7 +24,6 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.ColorLens
import androidx.compose.material.icons.outlined.TableRows
@ -42,8 +41,8 @@ import com.smarttoolfactory.extendedcolors.util.roundToTwoDigits
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.theme.toColor
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedSliderItem
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.HelperGridParams
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceRowSwitch
@ -52,7 +51,7 @@ fun HelperGridParamsSelector(
value: HelperGridParams,
onValueChange: (HelperGridParams) -> Unit,
modifier: Modifier = Modifier,
shape: Shape = RoundedCornerShape(24.dp),
shape: Shape = ShapeDefaults.extraLarge,
) {
Column(
modifier = modifier.container(
@ -85,7 +84,7 @@ fun HelperGridParamsSelector(
.fillMaxWidth()
.padding(horizontal = 8.dp)
.container(
shape = ContainerShapeDefaults.topShape,
shape = ShapeDefaults.top,
color = MaterialTheme.colorScheme.surface,
resultPadding = 0.dp
)
@ -101,7 +100,7 @@ fun HelperGridParamsSelector(
it.roundToTwoDigits()
},
valueSuffix = " Pt",
shape = ContainerShapeDefaults.centerShape,
shape = ShapeDefaults.center,
onValueChange = {
onValueChange(value.copy(cellWidth = it))
},
@ -117,7 +116,7 @@ fun HelperGridParamsSelector(
it.roundToTwoDigits()
},
valueSuffix = " Pt",
shape = ContainerShapeDefaults.bottomShape,
shape = ShapeDefaults.bottom,
onValueChange = {
onValueChange(value.copy(cellHeight = it))
},

View File

@ -32,7 +32,6 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.FormatPaint
import androidx.compose.material.icons.rounded.Architecture
@ -64,7 +63,7 @@ import com.t8rin.imagetoolbox.core.settings.presentation.provider.LocalSettingsS
import com.t8rin.imagetoolbox.core.settings.presentation.provider.LocalSimpleSettingsInteractor
import com.t8rin.imagetoolbox.core.ui.utils.helper.toModel
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedChip
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.animateContentSizeNoClip
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.other.LocalToastHostState
@ -116,7 +115,7 @@ fun ImageFormatSelector(
Column(
modifier = modifier
.container(
shape = RoundedCornerShape(24.dp),
shape = ShapeDefaults.extraLarge,
color = backgroundColor
)
.animateContentSizeNoClip()
@ -165,7 +164,7 @@ fun ImageFormatSelector(
.fillMaxWidth()
.padding(horizontal = 8.dp)
.container(
shape = ContainerShapeDefaults.shapeForIndex(0, entriesSize),
shape = ShapeDefaults.byIndex(0, entriesSize),
color = MaterialTheme.colorScheme.surface
)
.padding(horizontal = 8.dp, vertical = 12.dp)
@ -198,7 +197,7 @@ fun ImageFormatSelector(
.container(
color = MaterialTheme.colorScheme.surface,
resultPadding = 0.dp,
shape = ContainerShapeDefaults.shapeForIndex(1, entriesSize),
shape = ShapeDefaults.byIndex(1, entriesSize),
)
.fillMaxWidth()
.padding(horizontal = 16.dp, vertical = 12.dp),
@ -261,7 +260,7 @@ fun ImageFormatSelector(
.container(
color = MaterialTheme.colorScheme.surface,
resultPadding = 0.dp,
shape = ContainerShapeDefaults.shapeForIndex(index, entriesSize),
shape = ShapeDefaults.byIndex(index, entriesSize),
)
.fillMaxWidth(),
value = settingsState.backgroundForNoAlphaImageFormats,

View File

@ -22,7 +22,6 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.InsertDriveFile
import androidx.compose.material3.Icon
@ -52,6 +51,7 @@ import com.t8rin.imagetoolbox.core.ui.utils.content_pickers.rememberImagePicker
import com.t8rin.imagetoolbox.core.ui.utils.helper.ContextUtils.rememberFilename
import com.t8rin.imagetoolbox.core.ui.widget.dialogs.OneTimeImagePickingDialog
import com.t8rin.imagetoolbox.core.ui.widget.image.Picture
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceItemOverload
@Composable
@ -63,7 +63,7 @@ fun ImageSelector(
modifier: Modifier = Modifier,
autoShadowElevation: Dp = 1.dp,
color: Color = MaterialTheme.colorScheme.surfaceContainerLow,
shape: Shape = RoundedCornerShape(20.dp),
shape: Shape = ShapeDefaults.large,
contentScale: ContentScale = ContentScale.Crop
) {
val imagePicker = rememberImagePicker(onSuccess = onValueChange)
@ -132,7 +132,7 @@ fun FileSelector(
modifier: Modifier = Modifier,
autoShadowElevation: Dp = 1.dp,
color: Color = MaterialTheme.colorScheme.surfaceContainerLow,
shape: Shape = RoundedCornerShape(20.dp)
shape: Shape = ShapeDefaults.large
) {
val pickFileLauncher = rememberFilePicker(onSuccess = onValueChange)

View File

@ -17,7 +17,6 @@
package com.t8rin.imagetoolbox.core.ui.widget.controls.selection
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Place
import androidx.compose.material3.MaterialTheme
@ -26,9 +25,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.domain.model.Position
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
@Composable
fun PositionSelector(
@ -36,7 +35,7 @@ fun PositionSelector(
onValueChange: (Position) -> Unit,
entries: List<Position> = Position.entries,
modifier: Modifier = Modifier,
shape: Shape = RoundedCornerShape(20.dp),
shape: Shape = ShapeDefaults.large,
color: Color = MaterialTheme.colorScheme.surface,
selectedItemColor: Color = MaterialTheme.colorScheme.tertiary,
) {

View File

@ -34,7 +34,6 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.FitScreen
@ -74,7 +73,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedChip
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.image.AspectRatioSelector
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.animateContentSizeNoClip
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.fadingEdges
@ -127,7 +126,7 @@ fun PresetSelector(
swipeableContent = {
Column(
modifier = Modifier
.container(shape = RoundedCornerShape(24.dp))
.container(shape = ShapeDefaults.extraLarge)
.pointerInput(Unit) {
detectTapGestures(
onLongPress = {
@ -198,7 +197,7 @@ fun PresetSelector(
},
title = {},
aspectRatios = aspectRatios,
shape = ContainerShapeDefaults.topShape,
shape = ShapeDefaults.top,
color = MaterialTheme.colorScheme.surface,
unselectedCardColor = MaterialTheme.colorScheme.surfaceContainerHigh
)
@ -223,7 +222,7 @@ fun PresetSelector(
}
},
startIcon = Icons.Outlined.FitScreen,
shape = ContainerShapeDefaults.bottomShape,
shape = ShapeDefaults.bottom,
color = MaterialTheme.colorScheme.surface
)
Spacer(modifier = Modifier.height(8.dp))
@ -354,7 +353,7 @@ fun PresetSelector(
.fillMaxSize()
.container(
color = MaterialTheme.colorScheme.surfaceContainerLowest,
shape = RoundedCornerShape(24.dp),
shape = ShapeDefaults.extraLarge,
autoShadowElevation = 0.5.dp
)
) {

View File

@ -33,7 +33,6 @@ import androidx.compose.foundation.lazy.staggeredgrid.LazyHorizontalStaggeredGri
import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCells
import androidx.compose.foundation.lazy.staggeredgrid.items
import androidx.compose.foundation.lazy.staggeredgrid.rememberLazyStaggeredGridState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.ColorLens
import androidx.compose.material.icons.rounded.Speed
@ -68,6 +67,7 @@ import com.t8rin.imagetoolbox.core.resources.icons.QualityMedium
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButtonGroup
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedChip
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedSliderItem
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.fadingEdges
import com.t8rin.imagetoolbox.core.ui.widget.text.AutoSizeText
@ -121,7 +121,7 @@ fun QualitySelector(
)
) {
Column(
modifier = Modifier.container(RoundedCornerShape(24.dp))
modifier = Modifier.container(ShapeDefaults.extraLarge)
) {
actualImageFormat.compressionTypes.forEach { type ->
val currentIcon by remember(quality) {
@ -206,7 +206,7 @@ fun QualitySelector(
modifier = Modifier
.padding(4.dp)
.container(
shape = RoundedCornerShape(20.dp),
shape = ShapeDefaults.large,
color = MaterialTheme.colorScheme.surface
)
.padding(6.dp)
@ -245,7 +245,7 @@ fun QualitySelector(
modifier = Modifier
.padding(4.dp)
.container(
shape = RoundedCornerShape(20.dp),
shape = ShapeDefaults.large,
color = MaterialTheme.colorScheme.surface
)
.padding(6.dp)
@ -263,7 +263,7 @@ fun QualitySelector(
.fillMaxWidth()
.padding(4.dp)
.container(
shape = RoundedCornerShape(20.dp),
shape = ShapeDefaults.large,
color = MaterialTheme.colorScheme.surface
)
.padding(4.dp),
@ -319,7 +319,7 @@ fun QualitySelector(
.fillMaxWidth()
.padding(4.dp)
.container(
shape = RoundedCornerShape(20.dp),
shape = ShapeDefaults.large,
color = MaterialTheme.colorScheme.surface
)
) {

View File

@ -40,7 +40,6 @@ import androidx.compose.foundation.lazy.staggeredgrid.LazyHorizontalStaggeredGri
import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCells
import androidx.compose.foundation.lazy.staggeredgrid.items
import androidx.compose.foundation.lazy.staggeredgrid.rememberLazyStaggeredGridState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.ColorLens
import androidx.compose.material3.Badge
@ -78,7 +77,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedChip
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.animateShape
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.fadingEdges
@ -93,7 +92,7 @@ fun ScaleModeSelector(
onValueChange: (ImageScaleMode) -> Unit,
modifier: Modifier = Modifier,
backgroundColor: Color = Color.Unspecified,
shape: Shape = RoundedCornerShape(24.dp),
shape: Shape = ShapeDefaults.extraLarge,
enableItemsCardBackground: Boolean = true,
titlePadding: PaddingValues = PaddingValues(top = 8.dp),
titleArrangement: Arrangement.Horizontal = Arrangement.Center,
@ -174,8 +173,8 @@ fun ScaleModeSelector(
color = MaterialTheme.colorScheme.surface,
shape = animateShape(
if (isColorSpaceSelectionVisible) {
ContainerShapeDefaults.topShape
} else ContainerShapeDefaults.defaultShape
ShapeDefaults.top
} else ShapeDefaults.default
)
)
.padding(horizontal = 8.dp, vertical = 12.dp)
@ -249,7 +248,7 @@ fun ScaleModeSelector(
it.title
},
color = MaterialTheme.colorScheme.surface,
shape = ContainerShapeDefaults.bottomShape,
shape = ShapeDefaults.bottom,
modifier = Modifier
.fillMaxWidth()
.padding(top = 4.dp)
@ -290,7 +289,7 @@ fun ScaleModeSelector(
.fillMaxWidth()
.container(
color = containerColor,
shape = ContainerShapeDefaults.shapeForIndex(
shape = ShapeDefaults.byIndex(
index = index,
size = entries.size
),

View File

@ -18,7 +18,6 @@
package com.t8rin.imagetoolbox.core.ui.widget.dialogs
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Calculate
import androidx.compose.material3.Icon
@ -33,12 +32,12 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.github.keelar.exprk.Expressions
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.utils.provider.rememberLocalEssentials
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedAlertDialog
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import java.math.BigDecimal
@Composable
@ -92,7 +91,7 @@ fun CalculatorDialog(
},
text = {
OutlinedTextField(
shape = RoundedCornerShape(16.dp),
shape = ShapeDefaults.default,
value = calculatorExpression,
textStyle = MaterialTheme.typography.titleMedium.copy(textAlign = TextAlign.Center),
maxLines = 1,

View File

@ -54,7 +54,7 @@ import com.t8rin.imagetoolbox.core.ui.utils.content_pickers.Picker
import com.t8rin.imagetoolbox.core.ui.utils.provider.SafeLocalContainerColor
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedAlertDialog
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.fadingEdges
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceItem
import com.t8rin.imagetoolbox.core.ui.widget.saver.PicturePickerModeSaver
@ -126,7 +126,7 @@ fun OneTimeImagePickingDialog(
data.forEachIndexed { index, mode ->
val selected = selectedPickerMode.ordinal == mode.ordinal
val shape = ContainerShapeDefaults.shapeForIndex(
val shape = ShapeDefaults.byIndex(
index = index,
size = data.size
)

View File

@ -71,7 +71,7 @@ import com.t8rin.imagetoolbox.core.ui.utils.helper.toUiPath
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedAlertDialog
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.fadingEdges
import com.t8rin.imagetoolbox.core.ui.widget.other.RevealDirection
@ -198,7 +198,7 @@ fun OneTimeSaveLocationSelectionDialog(
MutableInteractionSource()
}
val isDragged by interactionSource.collectIsDraggedAsState()
val shape = ContainerShapeDefaults.shapeForIndex(
val shape = ShapeDefaults.byIndex(
index = index,
size = data.size + 1,
forceDefault = isDragged
@ -307,7 +307,7 @@ fun OneTimeSaveLocationSelectionDialog(
PreferenceItem(
title = stringResource(id = R.string.add_new_folder),
startIcon = Icons.Outlined.CreateNewFolder,
shape = ContainerShapeDefaults.bottomShape,
shape = ShapeDefaults.bottom,
titleFontStyle = PreferenceItemDefaults.TitleFontStyleSmall,
onClick = {
launcher.open(currentFolderUri)
@ -332,7 +332,7 @@ fun OneTimeSaveLocationSelectionDialog(
title = stringResource(id = R.string.custom_filename),
subtitle = stringResource(id = R.string.custom_filename_sub),
startIcon = Icons.Outlined.DriveFileRenameOutline,
shape = ContainerShapeDefaults.defaultShape,
shape = ShapeDefaults.default,
titleFontStyle = PreferenceItemDefaults.TitleFontStyleSmall,
onClick = {
createLauncher.make("$imageString.${formatForFilenameSelection.extension}")

View File

@ -130,6 +130,33 @@ fun EnhancedButtonGroup(
inactiveButtonColor: Color = MaterialTheme.colorScheme.surface,
activeButtonColor: Color = MaterialTheme.colorScheme.secondary,
isScrollable: Boolean = true
) {
EnhancedButtonGroup(
modifier = modifier,
enabled = enabled,
itemCount = itemCount,
selectedIndices = setOf(selectedIndex),
itemContent = itemContent,
title = title,
onIndexChange = onIndexChange,
inactiveButtonColor = inactiveButtonColor,
activeButtonColor = activeButtonColor,
isScrollable = isScrollable,
)
}
@Composable
fun EnhancedButtonGroup(
modifier: Modifier = defaultModifier,
enabled: Boolean = true,
itemCount: Int,
selectedIndices: Set<Int>,
itemContent: @Composable (item: Int) -> Unit,
title: @Composable RowScope.() -> Unit = {},
onIndexChange: (Int) -> Unit,
inactiveButtonColor: Color = MaterialTheme.colorScheme.surface,
activeButtonColor: Color = MaterialTheme.colorScheme.secondary,
isScrollable: Boolean = true,
) {
val settingsState = LocalSettingsState.current
@ -176,7 +203,7 @@ fun EnhancedButtonGroup(
.padding(
start = 6.dp,
end = 6.dp,
bottom = 8.dp,
bottom = 6.dp,
top = 8.dp
),
horizontalArrangement = Arrangement.spacedBy(ButtonGroupDefaults.ConnectedSpaceBetween),
@ -188,7 +215,7 @@ fun EnhancedButtonGroup(
MaterialTheme.colorScheme.surfaceContainer
}
val selected = index == selectedIndex
val selected = index in selectedIndices
EnhancedToggleButton(
enabled = enabled,
@ -219,10 +246,14 @@ fun EnhancedButtonGroup(
)
else -> ButtonGroupDefaults.connectedMiddleButtonShapes(
pressedShape = ButtonDefaults.pressedShape
pressedShape = ButtonDefaults.pressedShape,
)
},
elevation = elevation
elevation = elevation,
modifier = Modifier.then(
if (isScrollable) Modifier
else Modifier.weight(1f)
)
) {
itemContent(index)
}

View File

@ -24,7 +24,6 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.MaterialTheme
@ -43,6 +42,7 @@ import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.ui.theme.outlineVariant
import com.t8rin.imagetoolbox.core.ui.utils.provider.LocalContainerShape
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.shapeByInteraction
@ -56,8 +56,8 @@ fun EnhancedChip(
selectedContentColor: Color = MaterialTheme.colorScheme.contentColorFor(selectedColor),
unselectedColor: Color = MaterialTheme.colorScheme.surfaceContainerHigh,
unselectedContentColor: Color = MaterialTheme.colorScheme.onSurface,
shape: Shape = RoundedCornerShape(10.dp),
pressedShape: Shape = RoundedCornerShape(4.dp),
shape: Shape = ShapeDefaults.small,
pressedShape: Shape = ShapeDefaults.extraSmall,
interactionSource: MutableInteractionSource? = null,
defaultMinSize: Dp = 36.dp,
label: @Composable () -> Unit
@ -72,7 +72,7 @@ fun EnhancedChip(
)
val realInteractionSource = interactionSource ?: remember { MutableInteractionSource() }
val shape = shapeByInteraction(
val resultShape = shapeByInteraction(
shape = shape,
pressedShape = pressedShape,
interactionSource = realInteractionSource
@ -96,7 +96,7 @@ fun EnhancedChip(
else selectedColor
.copy(alpha = 0.9f)
.compositeOver(Color.Black),
shape = shape,
shape = resultShape,
autoShadowElevation = 0.5.dp
)
.then(

View File

@ -52,6 +52,7 @@ import com.t8rin.imagetoolbox.core.settings.presentation.provider.LocalSettingsS
import com.t8rin.imagetoolbox.core.ui.theme.mixedContainer
import com.t8rin.imagetoolbox.core.ui.theme.onMixedContainer
import com.t8rin.imagetoolbox.core.ui.utils.helper.ProvidesValue
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.containerFabBorder
import com.t8rin.imagetoolbox.core.ui.widget.modifier.shapeByInteraction
import kotlinx.coroutines.delay
@ -180,12 +181,12 @@ sealed class EnhancedFloatingActionButtonType(
data object Small : EnhancedFloatingActionButtonType(
size = 40.dp,
shape = RoundedCornerShape(12.dp)
shape = ShapeDefaults.small
)
data object Primary : EnhancedFloatingActionButtonType(
size = 56.dp,
shape = RoundedCornerShape(16.dp)
shape = ShapeDefaults.default
)
data object SecondaryHorizontal : EnhancedFloatingActionButtonType(
@ -202,7 +203,7 @@ sealed class EnhancedFloatingActionButtonType(
data object Large : EnhancedFloatingActionButtonType(
size = 96.dp,
shape = RoundedCornerShape(28.dp)
shape = ShapeDefaults.extremeLarge
)
class Custom(

View File

@ -33,7 +33,6 @@ import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.contentColorFor
import androidx.compose.runtime.Composable
@ -58,9 +57,12 @@ import com.t8rin.imagetoolbox.core.settings.presentation.provider.LocalSettingsS
import com.t8rin.imagetoolbox.core.ui.utils.animation.FancyTransitionEasing
import com.t8rin.imagetoolbox.core.ui.utils.helper.PredictiveBackObserver
import com.t8rin.imagetoolbox.core.ui.utils.provider.ProvideContainerDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.CornerSides
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.animateContentSizeNoClip
import com.t8rin.imagetoolbox.core.ui.widget.modifier.autoElevatedBorder
import com.t8rin.imagetoolbox.core.ui.widget.modifier.drawHorizontalStroke
import com.t8rin.imagetoolbox.core.ui.widget.modifier.only
import com.t8rin.modalsheet.ModalBottomSheetValue
import com.t8rin.modalsheet.ModalSheet
import com.t8rin.modalsheet.rememberModalBottomSheetState
@ -365,7 +367,7 @@ private fun GraphicsLayerScope.calculatePredictiveBackScaleY(progress: Float): F
object EnhancedBottomSheetDefaults {
val shape = RoundedCornerShape(topStart = 28.dp, topEnd = 28.dp)
val shape = ShapeDefaults.extremeLarge.only(CornerSides.Top)
val barContainerColor: Color
@Composable

View File

@ -36,7 +36,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
@ -69,6 +68,7 @@ import com.t8rin.imagetoolbox.core.domain.utils.trimTrailingZero
import com.t8rin.imagetoolbox.core.settings.presentation.provider.LocalSettingsState
import com.t8rin.imagetoolbox.core.ui.utils.helper.ProvidesValue
import com.t8rin.imagetoolbox.core.ui.widget.icon_shape.IconShapeContainer
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.animateContentSizeNoClip
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.value.ValueDialog
@ -94,7 +94,7 @@ fun EnhancedRangeSliderItem(
visible: Boolean = true,
color: Color = Color.Unspecified,
contentColor: Color? = null,
shape: Shape = RoundedCornerShape(16.dp),
shape: Shape = ShapeDefaults.default,
valueTextTapEnabled: Boolean = true,
behaveAsContainer: Boolean = true,
enabled: Boolean = true,

View File

@ -33,7 +33,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
@ -66,6 +65,7 @@ import com.t8rin.imagetoolbox.core.domain.utils.trimTrailingZero
import com.t8rin.imagetoolbox.core.settings.presentation.provider.LocalSettingsState
import com.t8rin.imagetoolbox.core.ui.utils.helper.ProvidesValue
import com.t8rin.imagetoolbox.core.ui.widget.icon_shape.IconShapeContainer
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.animateContentSizeNoClip
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.value.ValueDialog
@ -91,7 +91,7 @@ fun EnhancedSliderItem(
visible: Boolean = true,
color: Color = Color.Unspecified,
contentColor: Color? = null,
shape: Shape = RoundedCornerShape(16.dp),
shape: Shape = ShapeDefaults.default,
valueTextTapEnabled: Boolean = true,
behaveAsContainer: Boolean = true,
enabled: Boolean = true,

View File

@ -36,7 +36,6 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.CropFree
@ -75,6 +74,7 @@ import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.theme.outlineVariant
import com.t8rin.imagetoolbox.core.ui.theme.takeColorFromScheme
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.fadingEdges
import com.t8rin.imagetoolbox.core.ui.widget.text.RoundedTextField
@ -110,7 +110,7 @@ fun AspectRatioSelector(
enableFadingEdges: Boolean = true,
onAspectRatioChange: (DomainAspectRatio, AspectRatio) -> Unit,
color: Color = Color.Unspecified,
shape: Shape = RoundedCornerShape(24.dp),
shape: Shape = ShapeDefaults.extraLarge,
aspectRatios: List<DomainAspectRatio> = aspectRatios()
) {
@ -259,7 +259,7 @@ fun AspectRatioSelector(
Modifier
.padding(8.dp)
.container(
shape = RoundedCornerShape(24.dp),
shape = ShapeDefaults.extraLarge,
color = unselectedCardColor
)
) {
@ -287,7 +287,7 @@ fun AspectRatioSelector(
)
}
},
shape = RoundedCornerShape(12.dp),
shape = ShapeDefaults.small,
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Number
),
@ -324,7 +324,7 @@ fun AspectRatioSelector(
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Number
),
shape = RoundedCornerShape(12.dp),
shape = ShapeDefaults.small,
label = {
Text(stringResource(R.string.height, " "))
},

View File

@ -18,7 +18,6 @@
package com.t8rin.imagetoolbox.core.ui.widget.image
import android.graphics.Bitmap
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
@ -28,6 +27,7 @@ import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.t8rin.histogram.HistogramType
import com.t8rin.histogram.ImageHistogram
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
@Composable
fun HistogramChart(
@ -44,7 +44,7 @@ fun HistogramChart(
harmonizationColor: Color = MaterialTheme.colorScheme.primary,
linesThickness: Dp = 0.5.dp,
bordersColor: Color = MaterialTheme.colorScheme.outline,
bordersShape: Shape = RoundedCornerShape(2.dp)
bordersShape: Shape = ShapeDefaults.extraSmall
) {
when (model) {
is Bitmap -> {

View File

@ -83,6 +83,7 @@ import com.t8rin.imagetoolbox.core.ui.theme.takeColorFromScheme
import com.t8rin.imagetoolbox.core.ui.utils.helper.ContextUtils.rememberFileExtension
import com.t8rin.imagetoolbox.core.ui.utils.provider.LocalScreenSize
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedLoadingIndicator
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.advancedShadow
import com.t8rin.imagetoolbox.core.ui.widget.modifier.dragHandler
import kotlinx.coroutines.delay
@ -359,7 +360,7 @@ private fun ImageItem(
Box(
modifier
.clip(RoundedCornerShape(4.dp))
.clip(ShapeDefaults.extraSmall)
.background(bgColor)
) {
Picture(

View File

@ -31,7 +31,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.InsertDriveFile
import androidx.compose.material.icons.automirrored.rounded.NoteAdd
@ -59,6 +58,7 @@ import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.theme.takeColorFromScheme
import com.t8rin.imagetoolbox.core.ui.utils.helper.ContextUtils.rememberFilename
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.text.AutoSizeText
@ -112,7 +112,7 @@ fun UrisPreview(
if (uri != Uri.EMPTY) {
Box(
modifier = Modifier.container(
shape = RoundedCornerShape(4.dp),
shape = ShapeDefaults.extraSmall,
resultPadding = 0.dp,
color = MaterialTheme.colorScheme.surfaceContainerHighest
)
@ -213,7 +213,7 @@ fun UrisPreview(
Box(
modifier = Modifier
.container(
shape = RoundedCornerShape(4.dp),
shape = ShapeDefaults.extraSmall,
resultPadding = 0.dp,
color = MaterialTheme.colorScheme.surfaceContainerHigh
)

View File

@ -45,7 +45,7 @@ import com.t8rin.imagetoolbox.core.ui.utils.provider.LocalContainerShape
import com.t8rin.imagetoolbox.core.ui.utils.provider.SafeLocalContainerColor
fun Modifier.container(
shape: Shape = ContainerShapeDefaults.defaultShape,
shape: Shape = ShapeDefaults.default,
color: Color = Color.Unspecified,
resultPadding: Dp = 4.dp,
borderWidth: Dp = Dp.Unspecified,

View File

@ -52,10 +52,10 @@ import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
object ContainerShapeDefaults {
object ShapeDefaults {
@Composable
fun shapeForIndex(
fun byIndex(
index: Int,
size: Int,
forceDefault: Boolean = false,
@ -64,10 +64,10 @@ object ContainerShapeDefaults {
val internalShape by remember(index, size, forceDefault, vertical) {
derivedStateOf {
when {
index == -1 || size == 1 || forceDefault -> defaultShape
index == 0 && size > 1 -> if (vertical) topShape else leftShape
index == size - 1 -> if (vertical) bottomShape else rightShape
else -> centerShape
index == -1 || size == 1 || forceDefault -> default
index == 0 && size > 1 -> if (vertical) top else start
index == size - 1 -> if (vertical) bottom else end
else -> center
}
}
}
@ -80,76 +80,86 @@ object ContainerShapeDefaults {
)
}
val topShape = RoundedCornerShape(
val top = RoundedCornerShape(
topStart = 16.dp,
topEnd = 16.dp,
bottomStart = 6.dp,
bottomEnd = 6.dp
)
val centerShape = RoundedCornerShape(
val center = RoundedCornerShape(
topStart = 6.dp,
topEnd = 6.dp,
bottomStart = 6.dp,
bottomEnd = 6.dp
)
val bottomShape = RoundedCornerShape(
val bottom = RoundedCornerShape(
topStart = 6.dp,
topEnd = 6.dp,
bottomStart = 16.dp,
bottomEnd = 16.dp
)
val leftShape = RoundedCornerShape(
val start = RoundedCornerShape(
topStart = 16.dp,
topEnd = 4.dp,
bottomStart = 16.dp,
bottomEnd = 4.dp
)
val rightShape = RoundedCornerShape(
val end = RoundedCornerShape(
topStart = 4.dp,
topEnd = 16.dp,
bottomStart = 4.dp,
bottomEnd = 16.dp
)
val topRightShape = RoundedCornerShape(
val topEnd = RoundedCornerShape(
topEnd = 16.dp,
topStart = 4.dp,
bottomEnd = 4.dp,
bottomStart = 4.dp
)
val bottomRightShape = RoundedCornerShape(
val bottomEnd = RoundedCornerShape(
topEnd = 4.dp,
topStart = 4.dp,
bottomEnd = 16.dp,
bottomStart = 4.dp
)
val smallLeftShape = RoundedCornerShape(
val smallStart = RoundedCornerShape(
topStart = 12.dp,
topEnd = 4.dp,
bottomStart = 12.dp,
bottomEnd = 4.dp
)
val smallRightShape = RoundedCornerShape(
val smallEnd = RoundedCornerShape(
topEnd = 12.dp,
topStart = 4.dp,
bottomEnd = 12.dp,
bottomStart = 4.dp
)
val smallShape = RoundedCornerShape(12.dp)
val extremeSmall = RoundedCornerShape(2.dp)
val defaultShape = RoundedCornerShape(16.dp)
val extraSmall = RoundedCornerShape(4.dp)
val pressedShape = RoundedCornerShape(6.dp)
val pressed = RoundedCornerShape(6.dp)
val largeShape = RoundedCornerShape(20.dp)
val mini = RoundedCornerShape(8.dp)
val small = RoundedCornerShape(12.dp)
val default = RoundedCornerShape(16.dp)
val large = RoundedCornerShape(20.dp)
val extraLarge = RoundedCornerShape(24.dp)
val extremeLarge = RoundedCornerShape(28.dp)
@Composable
private inline fun CornerSize.animate(): Dp = animateDpAsState(

View File

@ -53,7 +53,7 @@ import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.ui.utils.animation.FancyTransitionEasing
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsCombinedClickable
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.animateContentSizeNoClip
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.shapeByInteraction
@ -65,8 +65,8 @@ fun ExpandableItem(
expandableContent: @Composable ColumnScope.(Boolean) -> Unit,
initialState: Boolean = false,
verticalArrangement: Arrangement.Vertical = Arrangement.Top,
shape: Shape = ContainerShapeDefaults.largeShape,
pressedShape: Shape = ContainerShapeDefaults.pressedShape,
shape: Shape = ShapeDefaults.large,
pressedShape: Shape = ShapeDefaults.pressed,
color: Color = Color.Unspecified,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
canExpand: Boolean = true,

View File

@ -20,7 +20,6 @@ package com.t8rin.imagetoolbox.core.ui.widget.other
import android.content.Context
import androidx.compose.animation.animateColorAsState
import androidx.compose.foundation.border
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.RadioButtonChecked
import androidx.compose.material.icons.rounded.RadioButtonUnchecked
@ -31,13 +30,13 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.settings.presentation.model.UiFontFamily
import com.t8rin.imagetoolbox.core.settings.presentation.provider.LocalSettingsState
import com.t8rin.imagetoolbox.core.ui.theme.Typography
import com.t8rin.imagetoolbox.core.ui.theme.takeColorFromScheme
import com.t8rin.imagetoolbox.core.ui.utils.provider.SafeLocalContainerColor
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceItem
@Composable
@ -46,7 +45,7 @@ fun FontSelectionItem(
onClick: () -> Unit,
modifier: Modifier = Modifier,
onLongClick: (() -> Unit)? = null,
shape: Shape = RoundedCornerShape(16.dp)
shape: Shape = ShapeDefaults.default
) {
val settingsState = LocalSettingsState.current
val (_, name, isVariable) = font
@ -73,7 +72,7 @@ fun FontSelectionItem(
.copy(alpha = 0.5f)
else Color.Transparent
).value,
shape = RoundedCornerShape(16.dp)
shape = ShapeDefaults.default
),
shape = shape,
endIcon = if (selected) Icons.Rounded.RadioButtonChecked else Icons.Rounded.RadioButtonUnchecked

View File

@ -22,7 +22,6 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Info
import androidx.compose.material3.Icon
@ -38,6 +37,7 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
@Composable
@ -46,7 +46,7 @@ fun InfoContainer(
modifier: Modifier = Modifier,
containerColor: Color = MaterialTheme.colorScheme.secondaryContainer.copy(0.2f),
contentColor: Color = MaterialTheme.colorScheme.onSecondaryContainer.copy(alpha = 0.5f),
shape: Shape = RoundedCornerShape(16.dp),
shape: Shape = ShapeDefaults.default,
icon: ImageVector? = Icons.Outlined.Info
) {
Row(

View File

@ -24,7 +24,6 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.KeyboardArrowDown
import androidx.compose.material.icons.rounded.Link
@ -45,7 +44,7 @@ import com.t8rin.imagetoolbox.core.settings.presentation.provider.LocalSettingsS
import com.t8rin.imagetoolbox.core.ui.utils.helper.LinkPreview
import com.t8rin.imagetoolbox.core.ui.utils.helper.LinkUtils
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.text.TitleItem
import kotlinx.coroutines.delay
@ -94,7 +93,7 @@ fun LinkPreviewList(
modifier = Modifier
.then(modifier)
.container(
shape = RoundedCornerShape(20.dp),
shape = ShapeDefaults.large,
resultPadding = 0.dp
)
.padding(8.dp)
@ -111,7 +110,7 @@ fun LinkPreviewList(
links.forEachIndexed { index, link ->
LinkPreviewCard(
linkPreview = link,
shape = ContainerShapeDefaults.shapeForIndex(
shape = ShapeDefaults.byIndex(
index = index,
size = links.size
)

View File

@ -43,7 +43,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.systemBarsPadding
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.ErrorOutline
import androidx.compose.material3.Card
@ -77,6 +76,7 @@ import com.t8rin.imagetoolbox.core.settings.presentation.provider.LocalSettingsS
import com.t8rin.imagetoolbox.core.ui.theme.harmonizeWithPrimary
import com.t8rin.imagetoolbox.core.ui.theme.outlineVariant
import com.t8rin.imagetoolbox.core.ui.utils.provider.LocalScreenSize
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.autoElevatedBorder
import com.t8rin.modalsheet.FullscreenPopup
import kotlinx.coroutines.CancellableContinuation
@ -315,7 +315,7 @@ object ToastDefaults {
@Composable
get() = MaterialTheme.colorScheme.inverseSurface.harmonizeWithPrimary()
val shape: Shape = RoundedCornerShape(26.dp)
val shape: Shape = ShapeDefaults.extremeLarge
}
private fun ToastDuration.toMillis(

View File

@ -20,7 +20,6 @@ package com.t8rin.imagetoolbox.core.ui.widget.palette_selection
import androidx.compose.animation.animateColorAsState
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.RadioButtonChecked
import androidx.compose.material.icons.rounded.RadioButtonUnchecked
@ -29,11 +28,11 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import com.t8rin.dynamic.theme.PaletteStyle
import com.t8rin.imagetoolbox.core.settings.presentation.provider.LocalSettingsState
import com.t8rin.imagetoolbox.core.ui.theme.takeColorFromScheme
import com.t8rin.imagetoolbox.core.ui.utils.provider.SafeLocalContainerColor
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceItem
@Composable
@ -63,7 +62,7 @@ fun PaletteStyleSelectionItem(
.copy(alpha = 0.5f)
else Color.Transparent
).value,
shape = RoundedCornerShape(16.dp)
shape = ShapeDefaults.default
),
endIcon = if (selected) Icons.Rounded.RadioButtonChecked else Icons.Rounded.RadioButtonUnchecked
)

View File

@ -45,7 +45,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
private val DefaultStartTransition: AnimatedContentTransitionScope<ImageVector>.() -> ContentTransform =
{
@ -70,8 +70,8 @@ fun PreferenceItem(
startIcon: ImageVector? = null,
endIcon: ImageVector? = null,
autoShadowElevation: Dp = 1.dp,
shape: Shape = ContainerShapeDefaults.defaultShape,
pressedShape: Shape = ContainerShapeDefaults.pressedShape,
shape: Shape = ShapeDefaults.default,
pressedShape: Shape = ShapeDefaults.pressed,
color: Color = Color.Unspecified,
contentColor: Color = contentColorFor(backgroundColor = color),
overrideIconShapeContentColor: Boolean = false,

View File

@ -58,7 +58,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsCombinedClickable
import com.t8rin.imagetoolbox.core.ui.widget.icon_shape.IconShapeContainer
import com.t8rin.imagetoolbox.core.ui.widget.icon_shape.IconShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.shapeByInteraction
@ -74,8 +74,8 @@ fun PreferenceItemOverload(
startIcon: (@Composable () -> Unit)? = null,
endIcon: (@Composable () -> Unit)? = null,
badge: (@Composable RowScope.() -> Unit)? = null,
shape: Shape = ContainerShapeDefaults.defaultShape,
pressedShape: Shape = ContainerShapeDefaults.pressedShape,
shape: Shape = ShapeDefaults.default,
pressedShape: Shape = ShapeDefaults.pressed,
color: Color = Color.Unspecified,
contentColor: Color = contentColorFor(backgroundColor = color),
overrideIconShapeContentColor: Boolean = false,

View File

@ -31,7 +31,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.LocalTextStyle
@ -55,7 +54,7 @@ import com.t8rin.imagetoolbox.core.settings.presentation.provider.LocalSettingsS
import com.t8rin.imagetoolbox.core.ui.utils.provider.ProvideContainerDefaults
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.icon_shape.IconShapeContainer
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.shapeByInteraction
@ -66,8 +65,8 @@ fun PreferenceRow(
subtitle: String? = null,
color: Color = Color.Unspecified,
enabled: Boolean = true,
shape: Shape = ContainerShapeDefaults.defaultShape,
pressedShape: Shape = ContainerShapeDefaults.pressedShape,
shape: Shape = ShapeDefaults.default,
pressedShape: Shape = ShapeDefaults.pressed,
contentColor: Color? = null,
applyHorizontalPadding: Boolean = true,
maxLines: Int = Int.MAX_VALUE,
@ -233,7 +232,7 @@ fun PreferenceRow(
onDisabledClick: (() -> Unit)? = null,
changeAlphaWhenDisabled: Boolean = true,
contentColor: Color? = null,
shape: Shape = RoundedCornerShape(16.dp),
shape: Shape = ShapeDefaults.default,
titleFontStyle: TextStyle = LocalTextStyle.current.copy(lineHeight = 18.sp),
startIcon: ImageVector?,
endContent: (@Composable () -> Unit)? = null,

View File

@ -19,7 +19,6 @@ package com.t8rin.imagetoolbox.core.ui.widget.preferences
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Check
import androidx.compose.material3.Icon
@ -36,6 +35,7 @@ import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.ui.theme.blend
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedSwitch
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
@Composable
fun PreferenceRowSwitch(
@ -48,7 +48,7 @@ fun PreferenceRowSwitch(
checked: Boolean,
color: Color = Color.Unspecified,
contentColor: Color? = null,
shape: Shape = RoundedCornerShape(16.dp),
shape: Shape = ShapeDefaults.default,
startContent: (@Composable () -> Unit)? = null,
resultModifier: Modifier = Modifier.padding(
horizontal = if (startContent != null) 0.dp else 16.dp,
@ -121,7 +121,7 @@ fun PreferenceRowSwitch(
onDisabledClick: (() -> Unit)? = null,
changeAlphaWhenDisabled: Boolean = true,
contentColor: Color? = null,
shape: Shape = RoundedCornerShape(16.dp),
shape: Shape = ShapeDefaults.default,
startIcon: ImageVector?,
onClick: (Boolean) -> Unit,
additionalContent: (@Composable () -> Unit)? = null,

View File

@ -74,7 +74,7 @@ import com.t8rin.imagetoolbox.core.ui.utils.helper.ImageUtils.localizedName
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceItem
import com.t8rin.imagetoolbox.core.ui.widget.text.AutoSizeText
import com.t8rin.imagetoolbox.core.ui.widget.text.RoundedTextField
@ -248,7 +248,7 @@ fun AddExifSheet(
color = MaterialTheme.colorScheme.secondaryContainer.copy(
animateFloatAsState(if (isSelected) 0.35f else 0.1f).value
),
shape = ContainerShapeDefaults.shapeForIndex(
shape = ShapeDefaults.byIndex(
index = index,
size = list.size
),

View File

@ -69,7 +69,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedBottomSheetDefault
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.text.AutoSizeText
import com.t8rin.imagetoolbox.core.ui.widget.text.TitleItem
@ -166,7 +166,7 @@ fun EditExifSheet(
.fillMaxWidth()
.container(
color = EnhancedBottomSheetDefaults.contentContainerColor,
shape = ContainerShapeDefaults.shapeForIndex(
shape = ShapeDefaults.byIndex(
index = index,
size = data.size
)

View File

@ -39,7 +39,6 @@ import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.GridItemSpan
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.rememberLazyGridState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Face5
import androidx.compose.material.icons.outlined.Face6
@ -75,7 +74,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.shapeByInteraction
import com.t8rin.imagetoolbox.core.ui.widget.other.EmojiItem
@ -251,8 +250,8 @@ fun EmojiSelectionSheet(
color = MaterialTheme.colorScheme.surfaceContainerHigh,
resultPadding = 0.dp,
shape = shapeByInteraction(
shape = ContainerShapeDefaults.defaultShape,
pressedShape = ContainerShapeDefaults.pressedShape,
shape = ShapeDefaults.default,
pressedShape = ShapeDefaults.pressed,
interactionSource = interactionSource
)
)
@ -358,7 +357,7 @@ fun EmojiSelectionSheet(
.fillMaxWidth()
.background(EnhancedBottomSheetDefaults.containerColor)
.padding(start = 16.dp, top = 20.dp, bottom = 8.dp, end = 16.dp),
shape = RoundedCornerShape(28.dp),
shape = ShapeDefaults.extremeLarge,
checked = emojiEnabled,
startIcon = Icons.Outlined.Face6,
onClick = {

View File

@ -59,6 +59,8 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.image.Picture
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.animateShape
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.other.BoxAnimatedVisibility
import com.t8rin.imagetoolbox.core.ui.widget.text.AutoSizeText
@ -108,7 +110,10 @@ fun PickImageFromUrisSheet(
else MaterialTheme.colorScheme.surfaceContainerHigh
)
val padding by animateDpAsState(if (selected) 12.dp else 4.dp)
val pictureShape by animateDpAsState(if (selected) 20.dp else 8.dp)
val pictureShape = animateShape(
if (selected) ShapeDefaults.large
else ShapeDefaults.mini
)
val borderWidth by animateDpAsState(if (selected) 1.5.dp else (-1).dp)
val borderColor by animateColorAsState(
if (selected) MaterialTheme.colorScheme.primaryContainer
@ -117,7 +122,7 @@ fun PickImageFromUrisSheet(
Box(
modifier = Modifier
.container(
shape = RoundedCornerShape(8.dp),
shape = ShapeDefaults.mini,
resultPadding = 0.dp,
color = color
)
@ -128,9 +133,9 @@ fun PickImageFromUrisSheet(
model = uri,
modifier = Modifier
.aspectRatio(1f)
.clip(RoundedCornerShape(pictureShape))
.clip(pictureShape)
.padding(padding)
.clip(RoundedCornerShape(pictureShape))
.clip(pictureShape)
.hapticsClickable {
onUriPicked(uri)
onDismiss()
@ -138,7 +143,7 @@ fun PickImageFromUrisSheet(
.border(
width = borderWidth,
color = borderColor,
shape = RoundedCornerShape(pictureShape)
shape = pictureShape
),
shape = RectangleShape,
contentScale = ContentScale.Fit

View File

@ -33,7 +33,6 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.ZoomIn
import androidx.compose.material3.MaterialTheme
@ -61,6 +60,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalSheetDragHandle
import com.t8rin.imagetoolbox.core.ui.widget.image.Picture
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.transparencyChecker
import com.t8rin.imagetoolbox.core.ui.widget.other.BoxAnimatedVisibility
@ -92,7 +92,7 @@ fun ZoomModalSheet(
.fillMaxSize()
.padding(horizontal = 16.dp)
.container(
shape = RoundedCornerShape(4.dp),
shape = ShapeDefaults.extraSmall,
color = MaterialTheme.colorScheme
.outlineVariant()
.copy(alpha = 0.1f),

View File

@ -21,7 +21,6 @@ import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.RangeSlider
import androidx.compose.material3.Slider
@ -37,6 +36,7 @@ import com.t8rin.imagetoolbox.core.ui.theme.outlineVariant
import com.t8rin.imagetoolbox.core.ui.theme.takeColorFromScheme
import com.t8rin.imagetoolbox.core.ui.utils.animation.animateFloatingRangeAsState
import com.t8rin.imagetoolbox.core.ui.utils.provider.SafeLocalContainerColor
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
@Composable
@ -62,7 +62,7 @@ fun M3Slider(
Modifier
.padding(vertical = 2.dp)
.container(
shape = RoundedCornerShape(12.dp),
shape = ShapeDefaults.small,
autoShadowElevation = animateDpAsState(
if (settingsState.drawSliderShadows) {
1.dp
@ -136,7 +136,7 @@ fun M3RangeSlider(
Modifier
.padding(vertical = 2.dp)
.container(
shape = RoundedCornerShape(12.dp),
shape = ShapeDefaults.small,
autoShadowElevation = animateDpAsState(
if (settingsState.drawSliderShadows) {
1.dp

View File

@ -30,7 +30,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.text.selection.TextSelectionColors
@ -64,6 +63,7 @@ import androidx.compose.ui.unit.sp
import com.t8rin.imagetoolbox.core.ui.theme.blend
import com.t8rin.imagetoolbox.core.ui.theme.inverse
import com.t8rin.imagetoolbox.core.ui.theme.outlineVariant
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.animateContentSizeNoClip
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
@ -74,7 +74,7 @@ fun RoundedTextField(
onValueChange: (String) -> Unit,
label: String = "",
hint: String = "",
shape: Shape = RoundedCornerShape(12.dp),
shape: Shape = ShapeDefaults.small,
startIcon: ImageVector? = null,
value: String,
isError: Boolean = false,
@ -148,7 +148,7 @@ fun RoundedTextField(
onValueChange: (String) -> Unit,
label: (@Composable () -> Unit)? = null,
hint: (@Composable () -> Unit)? = null,
shape: Shape = RoundedCornerShape(12.dp),
shape: Shape = ShapeDefaults.small,
startIcon: (@Composable () -> Unit)? = null,
value: String,
isError: Boolean = false,

View File

@ -21,7 +21,6 @@ import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material3.Icon
@ -40,12 +39,12 @@ import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.domain.utils.trimTrailingZero
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.resources.icons.Counter
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedAlertDialog
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import kotlin.math.pow
import kotlin.math.roundToInt
@ -91,7 +90,7 @@ fun ValueDialog(
verticalArrangement = Arrangement.Center
) {
OutlinedTextField(
shape = RoundedCornerShape(16.dp),
shape = ShapeDefaults.default,
value = value,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
textStyle = MaterialTheme.typography.titleMedium.copy(textAlign = TextAlign.Center),

View File

@ -23,7 +23,6 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.PhotoSizeSelectLarge
import androidx.compose.material.icons.outlined.RepeatOne
@ -44,6 +43,7 @@ import com.t8rin.imagetoolbox.core.domain.model.IntegerSize
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.widget.controls.ResizeImageField
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedSliderItem
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceRowSwitch
import com.t8rin.imagetoolbox.feature.apng_tools.domain.ApngParams
@ -89,7 +89,7 @@ fun ApngParamsSelector(
startIcon = Icons.Outlined.PhotoSizeSelectLarge,
modifier = Modifier.fillMaxWidth(),
color = Color.Unspecified,
shape = RoundedCornerShape(24.dp)
shape = ShapeDefaults.extraLarge
)
Spacer(modifier = Modifier.height(8.dp))
EnhancedSliderItem(
@ -120,7 +120,7 @@ fun ApngParamsSelector(
color = LocalContentColor.current.copy(0.5f),
modifier = Modifier
.padding(4.dp)
.container(RoundedCornerShape(20.dp))
.container(ShapeDefaults.large)
.padding(4.dp)
)
}
@ -139,7 +139,7 @@ fun ApngParamsSelector(
)
)
},
shape = RoundedCornerShape(24.dp)
shape = ShapeDefaults.extraLarge
)
Spacer(modifier = Modifier.height(8.dp))
EnhancedSliderItem(
@ -155,7 +155,7 @@ fun ApngParamsSelector(
)
)
},
shape = RoundedCornerShape(24.dp)
shape = ShapeDefaults.extraLarge
)
}
}

View File

@ -31,7 +31,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Save
import androidx.compose.material.icons.outlined.Share
@ -65,7 +64,7 @@ import com.t8rin.imagetoolbox.core.resources.icons.Base64
import com.t8rin.imagetoolbox.core.ui.utils.content_pickers.rememberFileCreator
import com.t8rin.imagetoolbox.core.ui.utils.provider.rememberLocalEssentials
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceItemDefaults
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceRow
@ -135,15 +134,15 @@ internal fun Base64ToolsTiles(component: Base64ToolsComponent) {
.height(IntrinsicSize.Max),
horizontalArrangement = Arrangement.spacedBy(4.dp)
) {
pasteTile(ContainerShapeDefaults.leftShape)
importTile(ContainerShapeDefaults.rightShape)
pasteTile(ShapeDefaults.start)
importTile(ShapeDefaults.end)
}
} else {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
.container(
shape = RoundedCornerShape(28.dp),
shape = ShapeDefaults.extremeLarge,
resultPadding = 0.dp
)
.padding(

View File

@ -65,6 +65,7 @@ import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.resources.icons.FolderCompare
import com.t8rin.imagetoolbox.core.ui.utils.provider.LocalScreenSize
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.drawHorizontalStroke
import com.t8rin.imagetoolbox.core.ui.widget.modifier.shapeByInteraction
import kotlinx.coroutines.launch
@ -137,7 +138,7 @@ internal fun ChecksumToolsTabs(
val interactionSource = remember { MutableInteractionSource() }
val shape = shapeByInteraction(
shape = RoundedCornerShape(42.dp),
pressedShape = RoundedCornerShape(16.dp),
pressedShape = ShapeDefaults.default,
interactionSource = interactionSource
)

View File

@ -53,7 +53,7 @@ import com.t8rin.imagetoolbox.core.ui.utils.content_pickers.rememberFolderOpener
import com.t8rin.imagetoolbox.core.ui.utils.provider.rememberLocalEssentials
import com.t8rin.imagetoolbox.core.ui.widget.buttons.PagerScrollPanel
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedLoadingIndicator
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.fadingEdges
import com.t8rin.imagetoolbox.core.ui.widget.modifier.negativePadding
import com.t8rin.imagetoolbox.core.ui.widget.other.InfoContainer
@ -99,7 +99,7 @@ internal fun ColumnScope.CompareWithUrisPage(
PreferenceRow(
title = stringResource(R.string.pick_files),
onClick = filePicker::pickFile,
shape = ContainerShapeDefaults.leftShape,
shape = ShapeDefaults.start,
titleFontStyle = PreferenceItemDefaults.TitleFontStyleCenteredSmall,
startIcon = Icons.Outlined.FileCopy,
drawStartIconContainer = false,
@ -114,7 +114,7 @@ internal fun ColumnScope.CompareWithUrisPage(
onClick = {
openDirectoryLauncher.open(previousFolder)
},
shape = ContainerShapeDefaults.rightShape,
shape = ShapeDefaults.end,
titleFontStyle = PreferenceItemDefaults.TitleFontStyleCenteredSmall,
startIcon = Icons.Outlined.FolderOpen,
drawStartIconContainer = false,

View File

@ -41,7 +41,7 @@ import com.t8rin.imagetoolbox.core.resources.icons.Interface
import com.t8rin.imagetoolbox.core.resources.icons.Puzzle
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.text.AutoSizeText
import com.t8rin.imagetoolbox.core.ui.widget.text.TitleItem
@ -64,7 +64,7 @@ fun CipherTipSheet(
Column(
modifier = Modifier
.container(
shape = ContainerShapeDefaults.topShape
shape = ShapeDefaults.top
)
.fillMaxWidth()
) {
@ -82,7 +82,7 @@ fun CipherTipSheet(
Column(
modifier = Modifier
.container(
shape = ContainerShapeDefaults.centerShape
shape = ShapeDefaults.center
)
.fillMaxWidth()
) {
@ -100,7 +100,7 @@ fun CipherTipSheet(
Column(
modifier = Modifier
.container(
shape = ContainerShapeDefaults.centerShape
shape = ShapeDefaults.center
)
.fillMaxWidth()
) {
@ -118,7 +118,7 @@ fun CipherTipSheet(
Column(
modifier = Modifier
.container(
shape = ContainerShapeDefaults.bottomShape
shape = ShapeDefaults.bottom
)
.fillMaxWidth()
) {

View File

@ -34,7 +34,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.AutoAwesomeMosaic
import androidx.compose.material.icons.rounded.FormatColorFill
@ -92,6 +91,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedSliderItem
import com.t8rin.imagetoolbox.core.ui.widget.image.AspectRatioSelector
import com.t8rin.imagetoolbox.core.ui.widget.image.AutoFilePicker
import com.t8rin.imagetoolbox.core.ui.widget.image.ImageNotPickedWidget
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.fadingEdges
import com.t8rin.imagetoolbox.core.ui.widget.modifier.shimmer
@ -284,7 +284,7 @@ fun CollageMakerContent(
modifier = Modifier
.zoomable(rememberZoomState())
.container(
shape = RoundedCornerShape(4.dp),
shape = ShapeDefaults.extraSmall,
resultPadding = 0.dp
)
.shimmer(visible = isLoading),
@ -293,7 +293,7 @@ fun CollageMakerContent(
Collage(
modifier = Modifier
.padding(4.dp)
.clip(RoundedCornerShape(4.dp))
.clip(ShapeDefaults.extraSmall)
.transparencyChecker(),
images = uris ?: emptyList(),
collageType = component.collageType,
@ -329,7 +329,7 @@ fun CollageMakerContent(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.container(
resultPadding = 0.dp,
shape = RoundedCornerShape(24.dp)
shape = ShapeDefaults.extraLarge
)
) {
Text(
@ -349,7 +349,7 @@ fun CollageMakerContent(
.height(100.dp)
.fadingEdges(state),
contentPadding = PaddingValues(16.dp),
shape = RoundedCornerShape(12.dp),
shape = ShapeDefaults.small,
itemModifierFactory = { isSelected ->
Modifier
.container(
@ -359,10 +359,10 @@ fun CollageMakerContent(
MaterialTheme.colorScheme.secondaryContainer
} else MaterialTheme.colorScheme.surfaceContainerLowest,
).value,
shape = RoundedCornerShape(12.dp)
shape = ShapeDefaults.small
)
.padding(8.dp)
.clip(RoundedCornerShape(2.dp))
.clip(ShapeDefaults.extremeSmall)
}
)
}
@ -370,7 +370,7 @@ fun CollageMakerContent(
modifier = Modifier
.fillMaxWidth()
.container(
shape = RoundedCornerShape(24.dp)
shape = ShapeDefaults.extraLarge
),
icon = Icons.Rounded.FormatColorFill,
value = component.backgroundColor,
@ -406,7 +406,7 @@ fun CollageMakerContent(
bottom = 10.dp
),
icon = Icons.Rounded.FormatLineSpacing,
shape = RoundedCornerShape(24.dp)
shape = ShapeDefaults.extraLarge
)
EnhancedSliderItem(
modifier = Modifier.fillMaxWidth(),
@ -425,7 +425,7 @@ fun CollageMakerContent(
bottom = 10.dp
),
icon = Icons.Rounded.RoundedCorner,
shape = RoundedCornerShape(24.dp)
shape = ShapeDefaults.extraLarge
)
EnhancedSliderItem(
modifier = Modifier.fillMaxWidth(),
@ -444,7 +444,7 @@ fun CollageMakerContent(
bottom = 10.dp
),
icon = Icons.Rounded.PhotoSizeSelectSmall,
shape = RoundedCornerShape(24.dp)
shape = ShapeDefaults.extraLarge
)
QualitySelector(
imageFormat = component.imageFormat,

View File

@ -22,7 +22,6 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
@ -46,6 +45,7 @@ import com.t8rin.imagetoolbox.core.settings.presentation.provider.rememberAppCol
import com.t8rin.imagetoolbox.core.ui.utils.helper.isPortraitOrientationAsState
import com.t8rin.imagetoolbox.core.ui.widget.AdaptiveLayoutScreen
import com.t8rin.imagetoolbox.core.ui.widget.controls.selection.ColorRowSelector
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.other.TopAppBarEmoji
import com.t8rin.imagetoolbox.core.ui.widget.text.marquee
@ -100,7 +100,7 @@ fun ColorToolsContent(
modifier = Modifier
.fillMaxWidth()
.container(
shape = RoundedCornerShape(20.dp)
shape = ShapeDefaults.large
),
title = stringResource(R.string.selected_color)
)

View File

@ -33,7 +33,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.BarChart
import androidx.compose.material.icons.rounded.ContentCopy
@ -64,6 +63,7 @@ import com.t8rin.imagetoolbox.core.ui.utils.helper.ContextUtils.copyToClipboard
import com.t8rin.imagetoolbox.core.ui.utils.helper.toHex
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedChip
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.transparencyChecker
import com.t8rin.imagetoolbox.core.ui.widget.other.ExpandableItem
import com.t8rin.imagetoolbox.core.ui.widget.other.LocalToastHostState
@ -146,7 +146,7 @@ internal fun ColorHarmonies(
modifier = Modifier
.heightIn(min = 120.dp)
.weight(1f)
.clip(RoundedCornerShape(8.dp))
.clip(ShapeDefaults.mini)
.transparencyChecker()
.background(boxColor)
.hapticsClickable {
@ -169,7 +169,7 @@ internal fun ColorHarmonies(
.size(28.dp)
.background(
color = boxColor.copy(alpha = 1f),
shape = RoundedCornerShape(8.dp)
shape = ShapeDefaults.mini
)
.padding(2.dp)
)
@ -182,7 +182,7 @@ internal fun ColorHarmonies(
.padding(4.dp)
.background(
color = boxColor.copy(alpha = 1f),
shape = RoundedCornerShape(8.dp)
shape = ShapeDefaults.mini
)
.padding(horizontal = 4.dp),
fontSize = 12.sp

View File

@ -24,7 +24,6 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.AutoGraph
import androidx.compose.material3.MaterialTheme
@ -40,6 +39,7 @@ import com.t8rin.histogram.HistogramType
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.widget.controls.selection.ImageSelector
import com.t8rin.imagetoolbox.core.ui.widget.image.HistogramChart
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.other.ExpandableItem
import com.t8rin.imagetoolbox.core.ui.widget.text.TitleItem
@ -70,7 +70,7 @@ internal fun ColorHistogram() {
imageUri = it
},
subtitle = stringResource(R.string.image_for_histogram),
shape = RoundedCornerShape(16.dp),
shape = ShapeDefaults.default,
color = MaterialTheme.colorScheme.surface
)
Column(
@ -86,7 +86,7 @@ internal fun ColorHistogram() {
initialType = HistogramType.RGB,
onSwapType = null,
linesThickness = 1.dp,
bordersShape = RoundedCornerShape(6.dp)
bordersShape = ShapeDefaults.pressed
)
HistogramChart(
model = imageUri,
@ -97,7 +97,7 @@ internal fun ColorHistogram() {
initialType = HistogramType.Brightness,
onSwapType = null,
linesThickness = 1.dp,
bordersShape = RoundedCornerShape(6.dp)
bordersShape = ShapeDefaults.pressed
)
HistogramChart(
model = imageUri,
@ -108,7 +108,7 @@ internal fun ColorHistogram() {
initialType = HistogramType.Camera,
onSwapType = null,
linesThickness = 1.dp,
bordersShape = RoundedCornerShape(6.dp)
bordersShape = ShapeDefaults.pressed
)
}
}

View File

@ -27,7 +27,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.ContentCopy
import androidx.compose.material.icons.rounded.ContentPaste
@ -57,6 +56,7 @@ import com.t8rin.imagetoolbox.core.ui.theme.inverse
import com.t8rin.imagetoolbox.core.ui.utils.helper.ContextUtils.copyToClipboard
import com.t8rin.imagetoolbox.core.ui.utils.helper.toHex
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.transparencyChecker
import com.t8rin.imagetoolbox.core.ui.widget.other.ExpandableItem
import com.t8rin.imagetoolbox.core.ui.widget.other.LocalToastHostState
@ -102,7 +102,7 @@ internal fun ColorInfo(
modifier = Modifier
.heightIn(min = 80.dp)
.fillMaxWidth()
.clip(RoundedCornerShape(16.dp))
.clip(ShapeDefaults.default)
.transparencyChecker()
.background(boxColor)
.hapticsClickable {
@ -125,7 +125,7 @@ internal fun ColorInfo(
.size(28.dp)
.background(
color = boxColor.copy(alpha = 1f),
shape = RoundedCornerShape(8.dp)
shape = ShapeDefaults.mini
)
.padding(2.dp)
)
@ -138,7 +138,7 @@ internal fun ColorInfo(
.padding(4.dp)
.background(
color = boxColor.copy(alpha = 1f),
shape = RoundedCornerShape(8.dp)
shape = ShapeDefaults.mini
)
.padding(horizontal = 4.dp),
fontSize = 12.sp
@ -156,7 +156,7 @@ internal fun ColorInfo(
.padding(4.dp)
.background(
color = boxColor.copy(alpha = 1f),
shape = RoundedCornerShape(8.dp)
shape = ShapeDefaults.mini
)
.padding(horizontal = 4.dp),
fontSize = 12.sp

View File

@ -28,7 +28,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Blender
import androidx.compose.material.icons.rounded.ContentCopy
@ -56,7 +55,6 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.smarttoolfactory.colordetector.parser.ColorNameParser
import com.t8rin.dynamic.theme.ColorTuple
import kotlinx.coroutines.launch
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.theme.inverse
import com.t8rin.imagetoolbox.core.ui.utils.helper.ContextUtils.copyToClipboard
@ -64,13 +62,14 @@ import com.t8rin.imagetoolbox.core.ui.utils.helper.toHex
import com.t8rin.imagetoolbox.core.ui.widget.controls.selection.ColorRowSelector
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedSliderItem
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.transparencyChecker
import com.t8rin.imagetoolbox.core.ui.widget.other.ExpandableItem
import com.t8rin.imagetoolbox.core.ui.widget.other.LocalToastHostState
import com.t8rin.imagetoolbox.core.ui.widget.saver.ColorSaver
import com.t8rin.imagetoolbox.core.ui.widget.text.TitleItem
import kotlinx.coroutines.launch
import kotlin.math.roundToInt
@Composable
@ -123,7 +122,7 @@ internal fun ColorMixing(
.fillMaxWidth()
.container(
color = MaterialTheme.colorScheme.surface,
shape = ContainerShapeDefaults.topShape
shape = ShapeDefaults.top
),
title = stringResource(R.string.color_to_mix)
)
@ -134,7 +133,7 @@ internal fun ColorMixing(
valueRange = 2f..15f,
onValueChange = { mixingVariation = it.roundToInt() },
internalStateTransformation = { it.roundToInt() },
shape = ContainerShapeDefaults.bottomShape,
shape = ShapeDefaults.bottom,
behaveAsContainer = true,
color = MaterialTheme.colorScheme.surface,
steps = 12
@ -159,7 +158,7 @@ internal fun ColorMixing(
.heightIn(min = 100.dp)
.fillMaxWidth()
.clip(
ContainerShapeDefaults.shapeForIndex(
ShapeDefaults.byIndex(
index = index,
size = mixedColors.size
)
@ -186,7 +185,7 @@ internal fun ColorMixing(
.size(28.dp)
.background(
color = boxColor.copy(alpha = 1f),
shape = RoundedCornerShape(8.dp)
shape = ShapeDefaults.mini
)
.padding(2.dp)
)
@ -199,9 +198,7 @@ internal fun ColorMixing(
.padding(4.dp)
.background(
color = boxColor.copy(alpha = 1f),
shape = RoundedCornerShape(
8.dp
)
shape = ShapeDefaults.mini
)
.padding(horizontal = 4.dp),
fontSize = 12.sp
@ -219,9 +216,7 @@ internal fun ColorMixing(
.padding(4.dp)
.background(
color = boxColor.copy(alpha = 1f),
shape = RoundedCornerShape(
8.dp
)
shape = ShapeDefaults.mini
)
.padding(horizontal = 4.dp),
fontSize = 12.sp

View File

@ -60,7 +60,7 @@ import com.t8rin.imagetoolbox.core.ui.utils.helper.ContextUtils.copyToClipboard
import com.t8rin.imagetoolbox.core.ui.utils.helper.toHex
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedSliderItem
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.transparencyChecker
import com.t8rin.imagetoolbox.core.ui.widget.other.ExpandableItem
import com.t8rin.imagetoolbox.core.ui.widget.other.LocalToastHostState
@ -161,7 +161,7 @@ internal fun ColorShading(
.heightIn(min = 100.dp)
.fillMaxWidth()
.clip(
ContainerShapeDefaults.shapeForIndex(
ShapeDefaults.byIndex(
index = index,
size = data.size
)
@ -188,7 +188,7 @@ internal fun ColorShading(
.size(28.dp)
.background(
color = boxColor.copy(alpha = 1f),
shape = RoundedCornerShape(8.dp)
shape = ShapeDefaults.mini
)
.padding(2.dp)
)

View File

@ -86,7 +86,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedIconButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedSlider
import com.t8rin.imagetoolbox.core.ui.widget.image.ImageNotPickedWidget
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.drawHorizontalStroke
import com.t8rin.imagetoolbox.core.ui.widget.other.BoxAnimatedVisibility
@ -186,7 +186,7 @@ internal fun CompareScreenContent(
},
allowAlpha = false,
modifier = Modifier.container(
shape = ContainerShapeDefaults.topShape
shape = ShapeDefaults.top
),
title = stringResource(R.string.highlight_color),
icon = Icons.Rounded.Highlight
@ -205,7 +205,7 @@ internal fun CompareScreenContent(
title = stringResource(R.string.pixel_comparison_type),
titleIcon = Icons.Rounded.Pix,
spanCount = 1,
shape = ContainerShapeDefaults.bottomShape,
shape = ShapeDefaults.bottom,
itemContentText = {
it.name
},

View File

@ -32,7 +32,6 @@ import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.VerticalDivider
import androidx.compose.runtime.Composable
@ -56,8 +55,8 @@ import coil3.transform.Transformation
import com.smarttoolfactory.beforeafter.BeforeAfterImage
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedLoadingIndicator
import com.t8rin.imagetoolbox.core.ui.widget.image.Picture
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.CornerSides
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.only
import com.t8rin.imagetoolbox.core.ui.widget.modifier.transparencyChecker
@ -78,9 +77,9 @@ internal fun CompareScreenContentImpl(
) {
val modifier = Modifier
.padding(16.dp)
.container(ContainerShapeDefaults.defaultShape)
.container(ShapeDefaults.default)
.padding(4.dp)
.clip(ContainerShapeDefaults.smallShape)
.clip(ShapeDefaults.small)
.transparencyChecker()
AnimatedContent(targetState = compareType) { type ->
@ -108,7 +107,7 @@ internal fun CompareScreenContentImpl(
uri = uri,
alignment = Alignment.TopStart,
enabled = isLabelsEnabled,
shape = ContainerShapeDefaults.defaultShape.only(
shape = ShapeDefaults.default.only(
CornerSides.BottomEnd
)
)
@ -124,8 +123,8 @@ internal fun CompareScreenContentImpl(
uri = uri,
alignment = Alignment.BottomEnd,
enabled = isLabelsEnabled,
shape = RoundedCornerShape(
topStart = 16.dp
shape = ShapeDefaults.default.only(
CornerSides.TopStart
)
)
}
@ -181,16 +180,16 @@ internal fun CompareScreenContentImpl(
uri = bitmapPair.first?.first,
alignment = Alignment.TopStart,
enabled = isLabelsEnabled,
shape = RoundedCornerShape(
bottomEnd = 16.dp
shape = ShapeDefaults.default.only(
CornerSides.BottomEnd
)
)
CompareLabel(
uri = bitmapPair.second?.first,
alignment = Alignment.BottomStart,
enabled = isLabelsEnabled,
shape = RoundedCornerShape(
topEnd = 16.dp
shape = ShapeDefaults.default.only(
CornerSides.TopEnd
)
)
} else {
@ -224,16 +223,16 @@ internal fun CompareScreenContentImpl(
uri = bitmapPair.first?.first,
alignment = Alignment.TopStart,
enabled = isLabelsEnabled,
shape = RoundedCornerShape(
bottomEnd = 16.dp
shape = ShapeDefaults.default.only(
CornerSides.BottomEnd
)
)
CompareLabel(
uri = bitmapPair.second?.first,
alignment = Alignment.TopEnd,
enabled = isLabelsEnabled,
shape = RoundedCornerShape(
bottomStart = 16.dp
shape = ShapeDefaults.default.only(
CornerSides.BottomStart
)
)
}
@ -278,12 +277,12 @@ internal fun CompareScreenContentImpl(
else Alignment.TopStart,
enabled = isLabelsEnabled,
shape = if (showSecondImage) {
RoundedCornerShape(
topStart = 16.dp
ShapeDefaults.default.only(
CornerSides.TopStart
)
} else {
RoundedCornerShape(
bottomEnd = 16.dp
ShapeDefaults.default.only(
CornerSides.BottomEnd
)
}
)
@ -319,8 +318,8 @@ internal fun CompareScreenContentImpl(
uri = bitmapPair.first?.first,
alignment = Alignment.TopStart,
enabled = isLabelsEnabled,
shape = RoundedCornerShape(
bottomEnd = 16.dp
shape = ShapeDefaults.default.only(
CornerSides.BottomEnd
)
)
}
@ -332,8 +331,8 @@ internal fun CompareScreenContentImpl(
modifier = Modifier.alpha(compareProgress / 100f),
alignment = Alignment.BottomEnd,
enabled = isLabelsEnabled,
shape = RoundedCornerShape(
topStart = 16.dp
shape = ShapeDefaults.default.only(
CornerSides.TopStart
)
)
}

View File

@ -52,9 +52,9 @@ import com.t8rin.imagetoolbox.core.ui.widget.dialogs.OneTimeSaveLocationSelectio
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.image.Picture
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults.bottomShape
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults.centerShape
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ContainerShapeDefaults.topShape
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults.bottom
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults.center
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults.top
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceItem
import com.t8rin.imagetoolbox.core.ui.widget.text.AutoSizeText
@ -122,7 +122,7 @@ internal fun CompareShareSheet(
onLongClick = {
showFolderSelectionDialog = true
},
shape = topShape,
shape = top,
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
@ -143,7 +143,7 @@ internal fun CompareShareSheet(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
shape = centerShape,
shape = center,
onClick = {
onCopy(imageFormat)
},
@ -156,7 +156,7 @@ internal fun CompareShareSheet(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
shape = bottomShape,
shape = bottom,
onClick = {
onShare(imageFormat)
},

View File

@ -26,7 +26,6 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Compare
import androidx.compose.material3.MaterialTheme
@ -53,6 +52,7 @@ import com.t8rin.imagetoolbox.core.ui.theme.outlineVariant
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedButton
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalBottomSheet
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedModalSheetDragHandle
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.transparencyChecker
import com.t8rin.imagetoolbox.core.ui.widget.text.AutoSizeText
@ -80,7 +80,7 @@ fun CompareSheet(
.weight(1f)
.padding(horizontal = 16.dp)
.container(
shape = RoundedCornerShape(4.dp),
shape = ShapeDefaults.extraSmall,
color = MaterialTheme.colorScheme
.outlineVariant()
.copy(alpha = 0.1f),
@ -97,7 +97,7 @@ fun CompareSheet(
if (before != null && after != null) {
BeforeAfterImage(
overlayStyle = OverlayStyle(),
modifier = Modifier.clip(RoundedCornerShape(4.dp)),
modifier = Modifier.clip(ShapeDefaults.extraSmall),
progress = animateFloatAsState(targetValue = progress).value,
onProgressChange = {
progress = it
@ -151,7 +151,7 @@ fun CompareSheet(
afterContent: @Composable () -> Unit,
visible: Boolean,
onDismiss: () -> Unit,
shape: Shape = RoundedCornerShape(4.dp)
shape: Shape = ShapeDefaults.extraSmall
) {
var progress by rememberSaveable(visible) { mutableFloatStateOf(50f) }
@ -166,7 +166,7 @@ fun CompareSheet(
.weight(1f)
.padding(horizontal = 16.dp)
.container(
shape = RoundedCornerShape(4.dp),
shape = ShapeDefaults.extraSmall,
color = MaterialTheme.colorScheme
.outlineVariant()
.copy(alpha = 0.1f),

View File

@ -17,14 +17,13 @@
package com.t8rin.imagetoolbox.feature.crop.presentation.components
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Rectangle
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceRowSwitch
@Composable
@ -40,6 +39,6 @@ fun CoercePointsToImageBoundsToggle(
subtitle = stringResource(R.string.coerce_points_to_image_bounds_sub),
startIcon = Icons.Outlined.Rectangle,
modifier = modifier,
shape = RoundedCornerShape(24.dp)
shape = ShapeDefaults.extraLarge
)
}

View File

@ -32,7 +32,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
@ -65,6 +64,7 @@ import com.t8rin.imagetoolbox.core.ui.theme.outlineVariant
import com.t8rin.imagetoolbox.core.ui.utils.content_pickers.rememberImagePicker
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.EnhancedSliderItem
import com.t8rin.imagetoolbox.core.ui.widget.enhanced.hapticsClickable
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.container
import com.t8rin.imagetoolbox.core.ui.widget.modifier.fadingEdges
import kotlinx.coroutines.launch
@ -77,7 +77,7 @@ fun CropMaskSelection(
loadImage: suspend (Uri) -> ImageBitmap?,
onCropMaskChange: (CropOutlineProperty) -> Unit,
color: Color = Color.Unspecified,
shape: Shape = RoundedCornerShape(24.dp)
shape: Shape = ShapeDefaults.extraLarge
) {
var cornerRadius by rememberSaveable { mutableIntStateOf(20) }
@ -172,7 +172,7 @@ fun CropMaskSelection(
visible = selectedItem.cropOutline.id == 1 || selectedItem.cropOutline.id == 2,
modifier = Modifier
.padding(start = 16.dp, end = 16.dp, bottom = 16.dp),
shape = RoundedCornerShape(16.dp),
shape = ShapeDefaults.default,
value = cornerRadius,
title = stringResource(R.string.radius),
icon = null,
@ -223,7 +223,7 @@ fun CropMaskSelection(
Column(
modifier = Modifier
.padding(start = 16.dp, end = 16.dp, bottom = 16.dp)
.container(shape = RoundedCornerShape(24.dp))
.container(shape = ShapeDefaults.extraLarge)
.padding(8.dp),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally

View File

@ -17,14 +17,13 @@
package com.t8rin.imagetoolbox.feature.crop.presentation.components
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.t8rin.imagetoolbox.core.resources.R
import com.t8rin.imagetoolbox.core.resources.icons.Perspective
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceRowSwitch
@Composable
@ -35,7 +34,7 @@ fun FreeCornersCropToggle(
) {
PreferenceRowSwitch(
modifier = modifier,
shape = RoundedCornerShape(24.dp),
shape = ShapeDefaults.extraLarge,
startIcon = Icons.Outlined.Perspective,
title = stringResource(R.string.free_corners),
subtitle = stringResource(R.string.free_corners_sub),

View File

@ -22,7 +22,6 @@ import android.net.Uri
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.runtime.Composable
import androidx.compose.runtime.derivedStateOf
@ -56,6 +55,7 @@ import com.t8rin.imagetoolbox.core.ui.widget.image.AutoFilePicker
import com.t8rin.imagetoolbox.core.ui.widget.image.ImageContainer
import com.t8rin.imagetoolbox.core.ui.widget.image.ImageCounter
import com.t8rin.imagetoolbox.core.ui.widget.image.ImageNotPickedWidget
import com.t8rin.imagetoolbox.core.ui.widget.modifier.ShapeDefaults
import com.t8rin.imagetoolbox.core.ui.widget.modifier.detectSwipes
import com.t8rin.imagetoolbox.core.ui.widget.other.TopAppBarEmoji
import com.t8rin.imagetoolbox.core.ui.widget.preferences.PreferenceItem
@ -209,7 +209,7 @@ fun DeleteExifContent(
modifier = Modifier.fillMaxWidth(),
title = stringResource(R.string.tags_to_remove),
subtitle = subtitle,
shape = RoundedCornerShape(24.dp),
shape = ShapeDefaults.extraLarge,
startIcon = Icons.Rounded.Exif,
endIcon = Icons.Rounded.MiniEdit
)

Some files were not shown because too many files have changed in this diff Show More