1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 22:00:03 -04:00

Move code from egui_demo_lib to egui_demo_app (#1540)

Also clean up feature names and dependencies
This commit is contained in:
Emil Ernerfeldt
2022-04-28 11:23:34 +02:00
committed by GitHub
parent 39917bec26
commit 355d70d2b9
46 changed files with 213 additions and 174 deletions

View File

@@ -29,8 +29,8 @@ impl Default for EasyMarkEditor {
}
}
impl epi::App for EasyMarkEditor {
fn update(&mut self, ctx: &egui::Context, _frame: &mut epi::Frame) {
impl EasyMarkEditor {
pub fn panels(&mut self, ctx: &egui::Context) {
egui::TopBottomPanel::bottom("easy_mark_bottom").show(ctx, |ui| {
let layout = egui::Layout::top_down(egui::Align::Center).with_main_justify(true);
ui.allocate_ui_with_layout(ui.available_size(), layout, |ui| {
@@ -42,10 +42,8 @@ impl epi::App for EasyMarkEditor {
self.ui(ui);
});
}
}
impl EasyMarkEditor {
fn ui(&mut self, ui: &mut egui::Ui) {
pub fn ui(&mut self, ui: &mut egui::Ui) {
egui::Grid::new("controls").show(ui, |ui| {
ui.checkbox(&mut self.highlight_editor, "Highlight editor");
egui::reset_button(ui, self);