adjust mainText on space

This commit is contained in:
mokapsing 2025-06-23 06:29:45 +00:00
parent 33a4d66343
commit d5e676bf6f
2 changed files with 5 additions and 2 deletions

View File

@ -70,7 +70,10 @@ data class InputMethodEntry(
constructor(name: String) : this("", name, "", "", "×", "", "", false)
val displayName: String
get() = name.ifEmpty { uniqueName }
get() = when {
subMode.name.isNullOrEmpty() -> name.ifEmpty { uniqueName }
else -> label.ifEmpty { name.ifEmpty { uniqueName } }
}
}
@Parcelize

View File

@ -167,7 +167,7 @@ class TextKeyboard(
override fun onInputMethodUpdate(ime: InputMethodEntry) {
space.mainText.text = buildString {
append(ime.displayName)
ime.subMode.run { label.ifEmpty { name.ifEmpty { null } } }?.let { append(" ($it)") }
ime.subMode.run { name.ifEmpty { label.ifEmpty { null } } }?.let { append(" $it") }
}
if (capsState != CapsState.None) {
switchCapsState()