You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Grid item created with ui.add_enabled_ui after ui.add_visible, uses wrong variable somehow.
To Reproduce
Clone eframe_template and modify update fn to:
impl epi::App for TemplateApp {
fn update(&mut self, ctx: &egui::Context, _frame: &mut epi::Frame) {
let column2_visible = false;
let column3_enabled = true;
egui::CentralPanel::default().show(ctx, |ui| {
// For some reason, value from column2_visible is used in add_enabled_ui
egui::Grid::new("grid").num_columns(3).show(ui, |ui| {
ui.label("First column");
ui.add_visible(column2_visible, egui::Label::new("Second column"));
ui.add_enabled_ui(column3_enabled, |ui| ui.button("This should be enabled"));
ui.end_row();
});
// But if we use add_visible_ui first, problem goes away
egui::Grid::new("grid2").num_columns(3).show(ui, |ui| {
ui.label("First column");
ui.add_visible_ui(column2_visible, |ui| ui.label("Second column"));
ui.add_enabled_ui(column3_enabled, |ui| ui.button("This is enabled"));
ui.end_row();
});
});
}
}
Expected behavior
There should be two buttons, both enabled.
Describe the bug
Grid item created with
ui.add_enabled
_ui afterui.add_visible
, uses wrong variable somehow.To Reproduce
Clone eframe_template and modify update fn to:
Expected behavior
There should be two buttons, both enabled.
Screenshots
https://i.imgur.com/myix3uu.png
Desktop (please complete the following information):
Additional context
This happens with both 0.17.0 and git master.
The text was updated successfully, but these errors were encountered: