|
@@ -3,7 +3,7 @@ package eu.mjdev.desktop.components.text
|
|
|
import androidx.compose.desktop.ui.tooling.preview.Preview
|
|
import androidx.compose.desktop.ui.tooling.preview.Preview
|
|
|
import androidx.compose.foundation.text.selection.SelectionContainer
|
|
import androidx.compose.foundation.text.selection.SelectionContainer
|
|
|
import androidx.compose.material.LocalTextStyle
|
|
import androidx.compose.material.LocalTextStyle
|
|
|
-import androidx.compose.material.Text
|
|
|
|
|
|
|
+import androidx.compose.material3.Text
|
|
|
import androidx.compose.runtime.Composable
|
|
import androidx.compose.runtime.Composable
|
|
|
import androidx.compose.ui.Modifier
|
|
import androidx.compose.ui.Modifier
|
|
|
import androidx.compose.ui.graphics.Color
|
|
import androidx.compose.ui.graphics.Color
|
|
@@ -36,7 +36,7 @@ fun TextAny(
|
|
|
softWrap: Boolean = true,
|
|
softWrap: Boolean = true,
|
|
|
minLines: Int = 1,
|
|
minLines: Int = 1,
|
|
|
maxLines: Int = Int.MAX_VALUE,
|
|
maxLines: Int = Int.MAX_VALUE,
|
|
|
- onTextLayout: (TextLayoutResult) -> Unit = {},
|
|
|
|
|
|
|
+ onTextLayout: ((TextLayoutResult) -> Unit)? = null,
|
|
|
style: TextStyle = LocalTextStyle.current,
|
|
style: TextStyle = LocalTextStyle.current,
|
|
|
textSelectionEnabled: Boolean = false
|
|
textSelectionEnabled: Boolean = false
|
|
|
) {
|
|
) {
|
|
@@ -45,7 +45,6 @@ fun TextAny(
|
|
|
text = textFrom(text),
|
|
text = textFrom(text),
|
|
|
modifier = modifier,
|
|
modifier = modifier,
|
|
|
color = color,
|
|
color = color,
|
|
|
- minLines = minLines,
|
|
|
|
|
fontSize = fontSize,
|
|
fontSize = fontSize,
|
|
|
fontStyle = fontStyle,
|
|
fontStyle = fontStyle,
|
|
|
fontWeight = fontWeight,
|
|
fontWeight = fontWeight,
|
|
@@ -57,8 +56,9 @@ fun TextAny(
|
|
|
overflow = overflow,
|
|
overflow = overflow,
|
|
|
softWrap = softWrap,
|
|
softWrap = softWrap,
|
|
|
maxLines = maxLines,
|
|
maxLines = maxLines,
|
|
|
|
|
+ minLines = minLines,
|
|
|
onTextLayout = onTextLayout,
|
|
onTextLayout = onTextLayout,
|
|
|
- style = style
|
|
|
|
|
|
|
+ style = style,
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
if (textSelectionEnabled) {
|
|
if (textSelectionEnabled) {
|