mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Rename Panel methods (#8192)
The three methods for showing a `Panel` are now: * `panel.show`: always show the panel. * `panel.show_collapsible`: show or hide the panel, with a slide animation in between. * `Panel::show_switched`: animate between two different panels: a thin/collapsed one and a thick/expanded one.
This commit is contained in:
@@ -36,7 +36,7 @@ struct MyApp {
|
||||
|
||||
impl eframe::App for MyApp {
|
||||
fn ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
|
||||
egui::CentralPanel::default().show_inside(ui, |ui| {
|
||||
egui::CentralPanel::default().show(ui, |ui| {
|
||||
ui.label("Hello from the root viewport");
|
||||
|
||||
ui.checkbox(
|
||||
@@ -72,7 +72,7 @@ impl eframe::App for MyApp {
|
||||
"This viewport is embedded in the parent window, and cannot be moved outside of it.",
|
||||
);
|
||||
} else {
|
||||
egui::CentralPanel::default().show_inside(ui, |ui| {
|
||||
egui::CentralPanel::default().show(ui, |ui| {
|
||||
ui.label("Hello from immediate viewport");
|
||||
|
||||
if ui.input(|i| i.viewport().close_requested()) {
|
||||
@@ -98,7 +98,7 @@ impl eframe::App for MyApp {
|
||||
"This viewport is embedded in the parent window, and cannot be moved outside of it.",
|
||||
);
|
||||
} else {
|
||||
egui::CentralPanel::default().show_inside(ui, |ui| {
|
||||
egui::CentralPanel::default().show(ui, |ui| {
|
||||
ui.label("Hello from deferred viewport");
|
||||
|
||||
if ui.input(|i| i.viewport().close_requested()) {
|
||||
|
||||
Reference in New Issue
Block a user