Merge pull request #179 from amir1376/bug/remove-underlines-from-menubar

remove underlines from MenuBar
This commit is contained in:
AmirHossein Abdolmotallebi 2024-11-11 08:49:10 +03:30 committed by GitHub
commit cedc85c03a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -78,20 +78,8 @@ fun MenuBar(
.wrapContentHeight(Alignment.CenterVertically) .wrapContentHeight(Alignment.CenterVertically)
) { ) {
val text = subMenu.title.collectAsState().value.rememberString() val text = subMenu.title.collectAsState().value.rememberString()
val (firstChar, leadingText) = remember(text) {
when (text.length) {
0 -> "" to ""
1 -> text to ""
else -> text.first().toString() to text.substring(1)
}
}
Text( Text(
buildAnnotatedString { text = text,
withStyle(SpanStyle(textDecoration = TextDecoration.Underline)) {
append(firstChar)
}
append(leadingText)
},
maxLines = 1, maxLines = 1,
fontSize = myTextSizes.base, fontSize = myTextSizes.base,
color = myColors.onBackground, color = myColors.onBackground,