Skip to content
Snippets Groups Projects
Commit 1f0ca358 authored by Federico Lolli's avatar Federico Lolli
Browse files

[plot] moved window creation at the end of the loop

parent 12558c28
No related branches found
No related tags found
1 merge request!13Refactored Mavlink Communication for Improved Reliability
...@@ -42,19 +42,6 @@ impl PaneBehavior for Plot2DPane { ...@@ -42,19 +42,6 @@ impl PaneBehavior for Plot2DPane {
fn ui(&mut self, ui: &mut egui::Ui, _: TileId) -> PaneResponse { fn ui(&mut self, ui: &mut egui::Ui, _: TileId) -> PaneResponse {
let mut response = PaneResponse::default(); let mut response = PaneResponse::default();
let mut settings = SourceSettings::new(&mut self.settings, &mut self.line_settings);
egui::Window::new("Plot Settings")
.id(ui.auto_id_with("plot_settings")) // TODO: fix this issue with ids
.auto_sized()
.collapsible(true)
.movable(true)
.open(&mut self.settings_visible)
.show(ui.ctx(), |ui| sources_window(ui, &mut settings));
if settings.are_sources_changed() {
self.state_valid = false;
}
let ctrl_pressed = ui.input(|i| i.modifiers.ctrl); let ctrl_pressed = ui.input(|i| i.modifiers.ctrl);
egui_plot::Plot::new("plot") egui_plot::Plot::new("plot")
...@@ -81,6 +68,19 @@ impl PaneBehavior for Plot2DPane { ...@@ -81,6 +68,19 @@ impl PaneBehavior for Plot2DPane {
.context_menu(|ui| show_menu(ui, &mut self.settings_visible)); .context_menu(|ui| show_menu(ui, &mut self.settings_visible));
}); });
let mut settings = SourceSettings::new(&mut self.settings, &mut self.line_settings);
egui::Window::new("Plot Settings")
.id(ui.auto_id_with("plot_settings")) // TODO: fix this issue with ids
.auto_sized()
.collapsible(true)
.movable(true)
.open(&mut self.settings_visible)
.show(ui.ctx(), |ui| sources_window(ui, &mut settings));
if settings.are_sources_changed() {
self.state_valid = false;
}
response response
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment