online indicator
This commit is contained in:
parent
e554dc30d0
commit
82b69bd6b9
1 changed files with 8 additions and 2 deletions
|
@ -393,7 +393,6 @@ fn laser_frame_producer(model: &mut LaserModel, frame: &mut laser::Frame){
|
|||
// println!("Cropped Points {} (was: {})", new_laser_points.len(), pointno);
|
||||
// }
|
||||
|
||||
|
||||
frame.add_lines(new_laser_points);
|
||||
return;
|
||||
}
|
||||
|
@ -628,12 +627,19 @@ fn update(_app: &App, model: &mut GuiModel, update: Update) {
|
|||
);
|
||||
|
||||
for (dac_id, _config) in per_laser_config.iter() {
|
||||
let is_available = laser_streams.contains_key(&dac_id);
|
||||
ui.style_mut().visuals.override_text_color = if is_available {Some(egui::Color32::RED)} else {None};
|
||||
ui.style_mut().visuals.widgets.inactive.bg_stroke = if is_available {egui::Stroke::new(2.0, egui::Color32::RED)} else {egui::Stroke::NONE};
|
||||
let name = if let Some(config) = per_laser_config.get(&dac_id) { config.name.clone() } else { "DAC".into() };
|
||||
let indicator = if is_available{"*"}else{""};
|
||||
ui.selectable_value(
|
||||
selected_stream,
|
||||
Some(dac_id.clone()),
|
||||
if let Some(config) = per_laser_config.get(&dac_id) { config.name.clone() } else { "DAC".into() }
|
||||
format!("{name}{indicator}")
|
||||
);
|
||||
}
|
||||
// reset
|
||||
ui.style_mut().visuals.override_text_color = None;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue