rog-aura: add proper labels for keys via &str into

This commit is contained in:
Luke D. Jones
2022-07-29 11:15:37 +12:00
parent 5e06aeabe9
commit 3330e4973f
7 changed files with 161 additions and 9 deletions

View File

@@ -30,13 +30,12 @@ impl<'a> RogApp<'a> {
// your boat
let shape = KeyShape::from(key);
let label = <&str>::from(key);
if shape.is_blank() || shape.is_spacer() {
blank(ui, shape);
} else if shape.is_group() {
let label = format!("{key:?}");
key_group(ui, colour, shape.ux(), shape.uy()).on_hover_text(label);
} else {
let label = format!("{key:?}");
key_shape(ui, colour, shape).on_hover_text(label);
}
}