core: layout: use built-in uppercase function for shift modifier

There are uppercase symbols outside the Latin alphabet. Use the built-in
uppercase function for displaying uppercase text due to the shift key.
This commit is contained in:
Richard Acayan 2024-09-30 22:02:58 -04:00
parent 0206b82a94
commit 0fa318ca7e

View file

@ -120,68 +120,11 @@ impl Part {
fn modify_shift_label(orig_sym: &KeyValue) -> KeyValue
{
match orig_sym {
KeyValue(Keysym::a, _)
=> KeyValue::from(Keysym::a, "A"),
KeyValue(Keysym::b, _)
=> KeyValue::from(Keysym::b, "B"),
KeyValue(Keysym::c, _)
=> KeyValue::from(Keysym::c, "C"),
KeyValue(Keysym::d, _)
=> KeyValue::from(Keysym::d, "D"),
KeyValue(Keysym::e, _)
=> KeyValue::from(Keysym::e, "E"),
KeyValue(Keysym::f, _)
=> KeyValue::from(Keysym::f, "F"),
KeyValue(Keysym::g, _)
=> KeyValue::from(Keysym::g, "G"),
KeyValue(Keysym::h, _)
=> KeyValue::from(Keysym::h, "H"),
KeyValue(Keysym::i, _)
=> KeyValue::from(Keysym::i, "I"),
KeyValue(Keysym::j, _)
=> KeyValue::from(Keysym::j, "J"),
KeyValue(Keysym::k, _)
=> KeyValue::from(Keysym::k, "K"),
KeyValue(Keysym::l, _)
=> KeyValue::from(Keysym::l, "L"),
KeyValue(Keysym::m, _)
=> KeyValue::from(Keysym::m, "M"),
KeyValue(Keysym::n, _)
=> KeyValue::from(Keysym::n, "N"),
KeyValue(Keysym::o, _)
=> KeyValue::from(Keysym::o, "O"),
KeyValue(Keysym::p, _)
=> KeyValue::from(Keysym::p, "P"),
KeyValue(Keysym::q, _)
=> KeyValue::from(Keysym::q, "Q"),
KeyValue(Keysym::r, _)
=> KeyValue::from(Keysym::r, "R"),
KeyValue(Keysym::s, _)
=> KeyValue::from(Keysym::s, "S"),
KeyValue(Keysym::t, _)
=> KeyValue::from(Keysym::t, "T"),
KeyValue(Keysym::u, _)
=> KeyValue::from(Keysym::u, "U"),
KeyValue(Keysym::v, _)
=> KeyValue::from(Keysym::v, "V"),
KeyValue(Keysym::w, _)
=> KeyValue::from(Keysym::w, "W"),
KeyValue(Keysym::x, _)
=> KeyValue::from(Keysym::x, "X"),
KeyValue(Keysym::y, _)
=> KeyValue::from(Keysym::y, "Y"),
KeyValue(Keysym::z, _)
=> KeyValue::from(Keysym::z, "Z"),
KeyValue(Keysym::ae, _)
=> KeyValue::from(Keysym::ae, "Æ"),
KeyValue(Keysym::oe, _)
=> KeyValue::from(Keysym::oe, "Œ"),
KeyValue(Keysym::mu, _)
=> KeyValue::from(Keysym::mu, "Μ"),
_ => orig_sym.clone(),
if Self::keyvalue_has_text(orig_sym) {
let upper = orig_sym.1.to_uppercase();
KeyValue(orig_sym.0, upper)
} else {
orig_sym.clone()
}
}
@ -334,6 +277,11 @@ impl Part {
KeyValue(Keysym::F12, _) => false,
KeyValue(Keysym::Delete, _) => false,
KeyValue(Keysym::Alt_L, _) => false,
KeyValue(Keysym::Control_L, _) => false,
KeyValue(Keysym::Meta_L, _) => false,
KeyValue(Keysym::XF86_Fn, _) => false,
KeyValue(_, l) => l != "",
}
}