Make the font smaller for the action key

This commit is contained in:
Jules Aguillon 2022-03-06 19:36:09 +01:00
parent e303008e66
commit 534e4cb843
2 changed files with 8 additions and 3 deletions

View File

@ -134,9 +134,9 @@ final class Config
*/ */
public KeyboardData modify_layout(KeyboardData kw) public KeyboardData modify_layout(KeyboardData kw)
{ {
// Update the name to avoid caching in KeyModifier
KeyValue action_key = (actionLabel == null) ? null : KeyValue action_key = (actionLabel == null) ? null :
new KeyValue(actionLabel, actionLabel, KeyValue.CHAR_NONE, KeyValue.getKeyByName("action").withNameAndSymbol(actionLabel, actionLabel);
KeyValue.EVENT_ACTION, KeyValue.FLAG_NOREPEAT);
return kw.replaceKeys(key -> { return kw.replaceKeys(key -> {
if (key == null) if (key == null)
return null; return null;

View File

@ -87,6 +87,11 @@ class KeyValue
return new KeyValue(name, s, c, eventCode, flags); return new KeyValue(name, s, c, eventCode, flags);
} }
public KeyValue withNameAndSymbol(String n, String s)
{
return new KeyValue(n, s, char_, eventCode, flags);
}
public KeyValue withFlags(int f) public KeyValue withFlags(int f)
{ {
return new KeyValue(name, symbol, char_, eventCode, f); return new KeyValue(name, symbol, char_, eventCode, f);
@ -240,7 +245,7 @@ class KeyValue
addSpecialKey("switch_emoji", "\uE812" , EVENT_SWITCH_EMOJI, FLAG_KEY_FONT | FLAG_SMALLER_FONT); addSpecialKey("switch_emoji", "\uE812" , EVENT_SWITCH_EMOJI, FLAG_KEY_FONT | FLAG_SMALLER_FONT);
addSpecialKey("switch_back_emoji", "ABC", EVENT_SWITCH_BACK_EMOJI); addSpecialKey("switch_back_emoji", "ABC", EVENT_SWITCH_BACK_EMOJI);
addSpecialKey("change_method", "\ue807", EVENT_CHANGE_METHOD, FLAG_KEY_FONT | FLAG_SMALLER_FONT); addSpecialKey("change_method", "\ue807", EVENT_CHANGE_METHOD, FLAG_KEY_FONT | FLAG_SMALLER_FONT);
addSpecialKey("action", "Action", EVENT_ACTION); // Will always be replaced addSpecialKey("action", "Action", EVENT_ACTION, FLAG_SMALLER_FONT); // Will always be replaced
addEventKey("esc", "Esc", KeyEvent.KEYCODE_ESCAPE, FLAG_SMALLER_FONT); addEventKey("esc", "Esc", KeyEvent.KEYCODE_ESCAPE, FLAG_SMALLER_FONT);
addEventKey("enter", "\ue800", KeyEvent.KEYCODE_ENTER, FLAG_KEY_FONT); addEventKey("enter", "\ue800", KeyEvent.KEYCODE_ENTER, FLAG_KEY_FONT);