1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -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:
Emil Ernerfeldt
2026-05-24 12:22:32 +02:00
committed by GitHub
parent 3cf844c542
commit 27559ef3fd
44 changed files with 159 additions and 99 deletions

View File

@@ -64,7 +64,7 @@ pub struct ColorTestApp {
impl DemoApp for ColorTestApp {
fn demo_ui(&mut self, ui: &mut egui::Ui, frame: &mut eframe::Frame) {
egui::CentralPanel::default().show_inside(ui, |ui| {
egui::CentralPanel::default().show(ui, |ui| {
if frame.is_web() {
ui.label(
"NOTE: Some old browsers stuck on WebGL1 without sRGB support will not pass the color test.",
@@ -302,7 +302,7 @@ impl eframe::App for WrapApp {
let mut cmd = Command::Nothing;
egui::Panel::top("wrap_app_top_bar")
.frame(egui::Frame::new().inner_margin(4))
.show_inside(ui, |ui| {
.show(ui, |ui| {
ui.horizontal_wrapped(|ui| {
ui.visuals_mut().button_frame = false;
self.bar_contents(ui, frame, &mut cmd);
@@ -311,7 +311,7 @@ impl eframe::App for WrapApp {
self.state.backend_panel.update(ui.ctx(), frame);
egui::CentralPanel::no_frame().show_inside(ui, |ui| {
egui::CentralPanel::no_frame().show(ui, |ui| {
if !is_mobile(ui.ctx()) {
cmd = self.backend_panel(ui, frame);
}
@@ -350,7 +350,7 @@ impl WrapApp {
egui::Panel::left("backend_panel")
.resizable(false)
.show_animated_inside(ui, &mut is_open, |ui| {
.show_collapsible(ui, &mut is_open, |ui| {
ui.add_space(4.0);
ui.vertical_centered(|ui| {
ui.heading("💻 Backend");