Skip to content

Commit

Permalink
WidgetGallery: hide spinner widget to save CPU in reactive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Jan 17, 2022
1 parent 9df0c68 commit 76ac41f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions egui_demo_lib/src/apps/demo/widget_gallery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,11 @@ impl WidgetGallery {
ui.add(doc_link_label("CollapsingHeader", "collapsing"));
ui.collapsing("Click to see what is hidden!", |ui| {
ui.horizontal_wrapped(|ui| {
ui.label(
"Not much, as it turns out - but here is a gold star for you for checking:",
);
ui.colored_label(egui::Color32::GOLD, "☆");
ui.spacing_mut().item_spacing.x = 0.0;
ui.label("It's a ");
ui.add(doc_link_label("Spinner", "spinner"));
ui.add_space(4.0);
ui.add(egui::Spinner::new());
});
});
ui.end_row();
Expand All @@ -229,10 +230,6 @@ impl WidgetGallery {
This toggle switch is just 15 lines of code.",
);
ui.end_row();

ui.add(doc_link_label("Spinner", "spinner"));
ui.add(egui::Spinner::new());
ui.end_row();
}
}

Expand Down

0 comments on commit 76ac41f

Please sign in to comment.