Skip to content

Commit e1dc846

Browse files
committed
Restore context menu on highlightable fields
Fixes #30
1 parent e68629c commit e1dc846

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/views/function_diff.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@ fn write_ins(
163163
} else {
164164
Color32::TRANSPARENT
165165
});
166-
if ui.add(Label::new(op_label).sense(Sense::click())).clicked() {
166+
if ui
167+
.add(Label::new(op_label).sense(Sense::click()))
168+
.context_menu(|ui| ins_context_menu(ui, ins))
169+
.clicked()
170+
{
167171
if highlighted_op {
168172
ins_view_state.highlight = HighlightKind::None;
169173
} else {
@@ -262,7 +266,11 @@ fn write_ins(
262266
write_text(")", base_color, &mut job, appearance.code_font.clone());
263267
}
264268
writing_offset = new_writing_offset;
265-
if ui.add(Label::new(job).sense(Sense::click())).clicked() {
269+
if ui
270+
.add(Label::new(job).sense(Sense::click()))
271+
.context_menu(|ui| ins_context_menu(ui, ins))
272+
.clicked()
273+
{
266274
if highlighted_arg {
267275
ins_view_state.highlight = HighlightKind::None;
268276
} else if matches!(arg, ObjInsArg::Reloc | ObjInsArg::RelocWithBase) {
@@ -444,7 +452,11 @@ fn asm_row_ui(
444452
},
445453
..Default::default()
446454
});
447-
if ui.add(Label::new(job).sense(Sense::click())).clicked() {
455+
if ui
456+
.add(Label::new(job).sense(Sense::click()))
457+
.context_menu(|ui| ins_context_menu(ui, ins))
458+
.clicked()
459+
{
448460
if addr_highlight {
449461
ins_view_state.highlight = HighlightKind::None;
450462
} else {

0 commit comments

Comments
 (0)