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:
parent
1992b22ca1
commit
63ee5a86a6
1 changed files with 2 additions and 2 deletions
|
|
@ -268,8 +268,8 @@ impl<D: Display, K: Keyboard> Button<D, K> {
|
||||||
let changed = self.update_modifier(modifier,
|
let changed = self.update_modifier(modifier,
|
||||||
ModState::Released,
|
ModState::Released,
|
||||||
ModState::Pressed);
|
ModState::Pressed);
|
||||||
if changed {
|
if changed && Layout::is_label_modifier(modifier) {
|
||||||
draw = draw + DrawOperation::from_modifier_edge(modifier);
|
draw = draw + DrawOperation::Labels;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.update_modifier(modifier,
|
self.update_modifier(modifier,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue