egui/egui_demo_lib/src/apps/demo/mod.rs
Emil Ernerfeldt 0b10fa5c29
Grid layout and widget gallery (#106)
* Wrap Layout and Region into a new struct Placer

* [egui] Add a simple grid layout

* Refactor CollapsingHeader code (simplify header painting)

* Fix: allow putting a CollapsingHeader inside of a grid layout

* [demo] Add a widget gallery

Closes https://github.com/emilk/egui/issues/88

* Add optional striped grid background
2021-01-11 20:58:36 +01:00

43 lines
1.1 KiB
Rust

//! Demo-code for showing how Egui is used.
//!
//! The demo-code is also used in benchmarks and tests.
// ----------------------------------------------------------------------------
mod app;
mod dancing_strings;
pub mod demo_window;
mod demo_windows;
mod drag_and_drop;
mod font_book;
pub mod font_contents_emoji;
pub mod font_contents_ubuntu;
mod painting;
mod scrolls;
mod sliders;
mod tests;
pub mod toggle_switch;
mod widget_gallery;
mod widgets;
mod window_options;
pub use {
app::*, dancing_strings::DancingStrings, demo_window::DemoWindow, demo_windows::*,
drag_and_drop::*, font_book::FontBook, painting::Painting, scrolls::Scrolls, sliders::Sliders,
tests::Tests, widget_gallery::*, widgets::Widgets, window_options::WindowOptions,
};
// ----------------------------------------------------------------------------
/// Something to view in the demo windows
pub trait View {
fn ui(&mut self, ui: &mut egui::Ui);
}
/// Something to view
pub trait Demo {
fn name(&self) -> &str;
/// Show windows, etc
fn show(&mut self, ctx: &egui::CtxRef, open: &mut bool);
}