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

Method update

objdiff-gui/src/app.rs:690–868  ·  view source on GitHub ↗

Called each time the UI needs repainting, which may be many times per second. Put your widgets into a `SidePanel`, `TopPanel`, `CentralPanel`, `Window` or `Area`.

(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame)

Source from the content-addressed store, hash-verified

688 /// Called each time the UI needs repainting, which may be many times per second.
689 /// Put your widgets into a `SidePanel`, `TopPanel`, `CentralPanel`, `Window` or `Area`.
690 fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
691 if self.should_relaunch {
692 ctx.send_viewport_cmd(egui::ViewportCommand::Close);
693 return;
694 }
695
696 self.pre_update(ctx);
697
698 let Self { state, appearance, view_state, .. } = self;
699 let ViewState {
700 jobs,
701 config_state,
702 demangle_state,
703 rlwinm_decode_state,
704 diff_state,
705 graphics_state,
706 frame_history,
707 show_appearance_config,
708 show_demangle,
709 show_rlwinm_decode,
710 show_project_config,
711 show_arch_config,
712 show_debug,
713 show_graphics,
714 show_jobs,
715 show_side_panel,
716 } = view_state;
717
718 frame_history.on_new_frame(ctx.input(|i| i.time), frame.info().cpu_usage);
719
720 let side_panel_available = diff_state.current_view == View::SymbolDiff;
721
722 egui::TopBottomPanel::top("top_panel").show(ctx, |ui| {
723 // Temporarily use pre-egui 0.32 menu. ComboBox within menu
724 // is currently broken. Issue TBD
725 #[allow(deprecated)]
726 egui::menu::bar(ui, |ui| {
727 if ui
728 .add_enabled(
729 side_panel_available,
730 egui::Button::new(if *show_side_panel { "⏴" } else { "⏵" }),
731 )
732 .on_hover_text("Toggle side panel")
733 .clicked()
734 {
735 *show_side_panel = !*show_side_panel;
736 }
737 ui.separator();
738 let bar_state = egui::menu::BarState::load(ui.ctx(), ui.id());
739 egui::menu::menu_button(ui, "File", |ui| {
740 #[cfg(debug_assertions)]
741 if ui.button("Debug…").clicked() {
742 *show_debug = !*show_debug;
743 ui.close();
744 }
745 if ui.button("Project…").clicked() {
746 *show_project_config = !*show_project_config;
747 ui.close();

Callers

nothing calls this directly

Calls 15

general_config_uiFunction · 0.85
jobs_menu_uiFunction · 0.85
config_uiFunction · 0.85
diff_view_uiFunction · 0.85
project_windowFunction · 0.85
appearance_windowFunction · 0.85
demangle_windowFunction · 0.85
rlwinm_decode_windowFunction · 0.85
arch_config_windowFunction · 0.85
debug_windowFunction · 0.85
graphics_windowFunction · 0.85
jobs_windowFunction · 0.85

Tested by

no test coverage detected