skip early on empty hint labels

This commit is contained in:
Helium314 2025-04-28 19:25:28 +02:00
parent 5eff3b992b
commit 8b36ff1c54

View file

@ -72,10 +72,10 @@ fun getHintLabel(popupSet: PopupSet<*>?, params: KeyboardParams, label: String):
} }
if (hintLabel != null) break if (hintLabel != null) break
} }
if (hintLabel in toolbarKeyStrings.values) if (hintLabel in toolbarKeyStrings.values || hintLabel.isNullOrEmpty())
hintLabel = null // better show nothing instead of the toolbar key label return null // better show nothing instead of the toolbar key label
return hintLabel?.let { KeySpecParser.getLabel(transformLabel(it, params)) } return KeySpecParser.getLabel(transformLabel(hintLabel!!, params))
// avoid e.g. !autoColumnOrder! as label // avoid e.g. !autoColumnOrder! as label
// this will avoid having labels on comma and period keys // this will avoid having labels on comma and period keys
?.takeIf { !it.startsWith("!") || it.count { it == '!' } != 2 } // excluding the special labels ?.takeIf { !it.startsWith("!") || it.count { it == '!' } != 2 } // excluding the special labels