Skip to content

Commit ed4beaf

Browse files
committed
add hover for type descriptor
1 parent 95d1e1d commit ed4beaf

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

asm_egui/src/smali.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,17 @@ fn token(
4949
let text = format!("v{start}..v{end}");
5050
simple_text(ui, text, font, smali_style.register)
5151
}
52-
SmaliToken::Descriptor(s) => simple_text(ui, s.to_string(), font, smali_style.desc),
52+
SmaliToken::Descriptor(s) => {
53+
let text_ui = simple_text(ui, s.to_string(), font, smali_style.desc)
54+
.on_hover_ui(|ui| {
55+
ui.style_mut().interaction.selectable_labels = true;
56+
ui.label(format!("descriptor: {s}"));
57+
});
58+
text_ui.context_menu(|ui| {
59+
ui.label(format!("descriptor: {s}"));
60+
});
61+
text_ui
62+
},
5363
SmaliToken::Literal(s) => simple_text(ui, s.to_string(), font, smali_style.literal),
5464
SmaliToken::Other(s) => simple_text(ui, s.to_string(), font, dft_color),
5565
}

0 commit comments

Comments
 (0)