mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -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:
@@ -25,7 +25,7 @@ impl Custom3d {
|
||||
impl crate::DemoApp for Custom3d {
|
||||
fn demo_ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
|
||||
// TODO(emilk): Use `ScrollArea::content_margin`
|
||||
egui::CentralPanel::default().show_inside(ui, |ui| {
|
||||
egui::CentralPanel::default().show(ui, |ui| {
|
||||
egui::ScrollArea::both().auto_shrink(false).show(ui, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
ui.spacing_mut().item_spacing.x = 0.0;
|
||||
|
||||
@@ -103,7 +103,7 @@ impl Custom3d {
|
||||
impl crate::DemoApp for Custom3d {
|
||||
fn demo_ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
|
||||
// TODO(emilk): Use `ScrollArea::content_margin`
|
||||
egui::CentralPanel::default().show_inside(ui, |ui| {
|
||||
egui::CentralPanel::default().show(ui, |ui| {
|
||||
egui::ScrollArea::both().auto_shrink(false).show(ui, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
ui.spacing_mut().item_spacing.x = 0.0;
|
||||
|
||||
@@ -61,14 +61,14 @@ impl Default for HttpApp {
|
||||
|
||||
impl crate::DemoApp for HttpApp {
|
||||
fn demo_ui(&mut self, ui: &mut egui::Ui, frame: &mut eframe::Frame) {
|
||||
egui::Panel::bottom("http_bottom").show_inside(ui, |ui| {
|
||||
egui::Panel::bottom("http_bottom").show(ui, |ui| {
|
||||
let layout = egui::Layout::top_down(egui::Align::Center).with_main_justify(true);
|
||||
ui.allocate_ui_with_layout(ui.available_size(), layout, |ui| {
|
||||
ui.add(egui_demo_lib::egui_github_link_file!())
|
||||
})
|
||||
});
|
||||
|
||||
egui::CentralPanel::default().show_inside(ui, |ui| {
|
||||
egui::CentralPanel::default().show(ui, |ui| {
|
||||
let prev_url = self.url.clone();
|
||||
let trigger_fetch = ui_url(ui, frame, &mut self.url);
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ impl Default for ImageViewer {
|
||||
|
||||
impl crate::DemoApp for ImageViewer {
|
||||
fn demo_ui(&mut self, ui: &mut egui::Ui, _: &mut eframe::Frame) {
|
||||
egui::Panel::top("url bar").show_inside(ui, |ui| {
|
||||
egui::Panel::top("url bar").show(ui, |ui| {
|
||||
ui.horizontal_centered(|ui| {
|
||||
let label = ui.label("URI:");
|
||||
ui.text_edit_singleline(&mut self.uri_edit_text)
|
||||
@@ -71,7 +71,7 @@ impl crate::DemoApp for ImageViewer {
|
||||
});
|
||||
});
|
||||
|
||||
egui::Panel::left("controls").show_inside(ui, |ui| {
|
||||
egui::Panel::left("controls").show(ui, |ui| {
|
||||
// uv
|
||||
ui.label("UV");
|
||||
ui.add(Slider::new(&mut self.image_options.uv.min.x, 0.0..=1.0).text("min x"));
|
||||
@@ -197,7 +197,7 @@ impl crate::DemoApp for ImageViewer {
|
||||
}
|
||||
});
|
||||
|
||||
egui::CentralPanel::default().show_inside(ui, |ui| {
|
||||
egui::CentralPanel::default().show(ui, |ui| {
|
||||
egui::ScrollArea::both().show(ui, |ui| {
|
||||
let mut image = egui::Image::from_uri(&self.current_uri);
|
||||
image = image.uv(self.image_options.uv);
|
||||
|
||||
Reference in New Issue
Block a user