core: button: only draw the modifier key when pressed

When one modifier key is released, only the same key is drawn, even if
there are other identical modifier keys. Be consistent with this
optimization, and only draw the exact key that was pressed when a
modifier key is pressed.
This commit is contained in:
Richard Acayan 2024-08-12 19:16:33 -04:00
parent 1992b22ca1
commit 63ee5a86a6

View file

@ -268,8 +268,8 @@ impl<D: Display, K: Keyboard> Button<D, K> {
let changed = self.update_modifier(modifier,
ModState::Released,
ModState::Pressed);
if changed {
draw = draw + DrawOperation::from_modifier_edge(modifier);
if changed && Layout::is_label_modifier(modifier) {
draw = draw + DrawOperation::Labels;
}
self.update_modifier(modifier,