Browse Source

WidgetGallery: hide spinner widget to save CPU in reactive mode

pull/1132/head
Emil Ernerfeldt 3 years ago
parent
commit
76ac41f9b5
  1. 13
      egui_demo_lib/src/apps/demo/widget_gallery.rs

13
egui_demo_lib/src/apps/demo/widget_gallery.rs

@ -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();
@ -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();
}
}

Loading…
Cancel
Save