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

@@ -42,6 +42,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
})?;
let mut board_name = String::new();
file.read_to_string(&mut board_name)?;
board_name = "G533".to_string();
let mut layout = KeyLayout::ga401_layout(); // default
let mut path = PathBuf::from(DATA_DIR);

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);
}
}