diff --git a/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/character/trappings/TransactionDialog.kt b/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/character/trappings/TransactionDialog.kt index 62313b39a..e0fecd59c 100644 --- a/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/character/trappings/TransactionDialog.kt +++ b/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/character/trappings/TransactionDialog.kt @@ -181,6 +181,7 @@ private fun RowScope.CoinInput(value: InputValue, label: String, validate: Boole validate = validate, keyboardOptions = KeyboardOptions.Default.copy(keyboardType = KeyboardType.Number), maxLength = 4, + showCharacterCount = false, placeholder = "0", ) } diff --git a/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/characterCreation/CharacterCharacteristicsForm.kt b/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/characterCreation/CharacterCharacteristicsForm.kt index 1a50821de..295af7446 100644 --- a/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/characterCreation/CharacterCharacteristicsForm.kt +++ b/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/characterCreation/CharacterCharacteristicsForm.kt @@ -201,6 +201,7 @@ private fun CharacteristicInputs( horizontalAlignment = Alignment.CenterHorizontally, validate = validate, maxLength = 3, + showCharacterCount = false, placeholder = "0", ) @@ -213,6 +214,7 @@ private fun CharacteristicInputs( horizontalAlignment = Alignment.CenterHorizontally, validate = validate, maxLength = 3, + showCharacterCount = false, placeholder = "0", ) } diff --git a/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/core/ui/forms/CareerSelectBox.kt b/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/core/ui/forms/CareerSelectBox.kt index 9f0bc80e4..595014b08 100644 --- a/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/core/ui/forms/CareerSelectBox.kt +++ b/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/core/ui/forms/CareerSelectBox.kt @@ -111,7 +111,10 @@ fun CareerSelectBox( label = null, onClick = { dialogOpened = true }, ) { - Text(itemValue ?: LocalStrings.current.commonUi.itemNone) + Text( + itemValue ?: LocalStrings.current.commonUi.itemNone, + maxLines = 1, + ) } } diff --git a/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/core/ui/forms/SelectBox.kt b/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/core/ui/forms/SelectBox.kt index 93c702950..80870340b 100644 --- a/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/core/ui/forms/SelectBox.kt +++ b/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/core/ui/forms/SelectBox.kt @@ -111,7 +111,7 @@ fun SelectBoxToggle( .padding(Spacing.medium), horizontalArrangement = Arrangement.SpaceBetween, ) { - Row { content() } + Row(Modifier.weight(1f), content = content) Icon( Icons.Rounded.ExpandMore, LocalStrings.current.commonUi.labelExpandSelectBox, diff --git a/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/core/ui/forms/TextInput.kt b/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/core/ui/forms/TextInput.kt index d30ecbab9..cbd093ae7 100644 --- a/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/core/ui/forms/TextInput.kt +++ b/common/src/commonMain/kotlin/cz/frantisekmasa/wfrp_master/common/core/ui/forms/TextInput.kt @@ -68,6 +68,7 @@ fun TextInput( keyboardOptions: KeyboardOptions = KeyboardOptions.Default, keyboardActions: KeyboardActions = KeyboardActions.Default, maxLength: Int = Int.MAX_VALUE, + showCharacterCount: Boolean = maxLength < Int.MAX_VALUE, multiLine: Boolean = false, placeholder: String? = null, horizontalAlignment: Alignment.Horizontal = Alignment.Start, @@ -88,6 +89,7 @@ fun TextInput( horizontalAlignment = horizontalAlignment, filters = filters, modifier = modifier, + showCharacterCount = showCharacterCount, rules = value.rules, visualTransformation = visualTransformation, ) @@ -104,6 +106,7 @@ private fun TextInput( keyboardOptions: KeyboardOptions, keyboardActions: KeyboardActions, maxLength: Int = Int.MAX_VALUE, + showCharacterCount: Boolean, multiLine: Boolean = false, placeholder: String? = null, horizontalAlignment: Alignment.Horizontal = Alignment.Start, @@ -169,7 +172,7 @@ private fun TextInput( } } - if (maxLength < Int.MAX_VALUE || helperText.isNullOrBlank()) { + if (showCharacterCount || helperText.isNullOrBlank()) { CompositionLocalProvider(LocalContentAlpha provides ContentAlpha.medium) { Row { if (!helperText.isNullOrBlank()) { @@ -178,7 +181,7 @@ private fun TextInput( Spacer(Modifier.weight(1f)) - if (maxLength < Int.MAX_VALUE) { + if (showCharacterCount) { Text( "${value.length} / $maxLength", style = MaterialTheme.typography.overline,