MCPcopy Index your code
hub / github.com/encounter/objdiff / symbol_context_menu_ui

Function symbol_context_menu_ui

objdiff-gui/src/views/symbol_diff.rs:499–532  ·  view source on GitHub ↗
(
    ui: &mut Ui,
    ctx: SymbolDiffContext<'_>,
    symbol_idx: usize,
    symbol: &Symbol,
    section: Option<&Section>,
    column: usize,
    appearance: &Appearance,
)

Source from the content-addressed store, hash-verified

497}
498
499pub fn symbol_context_menu_ui(
500 ui: &mut Ui,
501 ctx: SymbolDiffContext<'_>,
502 symbol_idx: usize,
503 symbol: &Symbol,
504 section: Option<&Section>,
505 column: usize,
506 appearance: &Appearance,
507) -> Option<DiffViewAction> {
508 let mut ret = None;
509 ui.scope(|ui| {
510 ui.style_mut().override_text_style = Some(egui::TextStyle::Monospace);
511 ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Truncate);
512
513 if let Some(action) =
514 context_menu_items_ui(ui, symbol_context(ctx.obj, symbol_idx), column, appearance)
515 {
516 ret = Some(action);
517 }
518
519 if let Some(section) = section
520 && ui.button("Map symbol").clicked()
521 {
522 let symbol_ref = SymbolRefByName::new(symbol, Some(section));
523 if column == 0 {
524 ret = Some(DiffViewAction::SelectingRight(symbol_ref));
525 } else {
526 ret = Some(DiffViewAction::SelectingLeft(symbol_ref));
527 }
528 ui.close();
529 }
530 });
531 ret
532}
533
534pub fn symbol_hover_ui(
535 ui: &mut Ui,

Callers 2

symbol_uiFunction · 0.85
symbol_label_uiFunction · 0.85

Calls 2

context_menu_items_uiFunction · 0.85
symbol_contextFunction · 0.85

Tested by

no test coverage detected