1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 14:49:06 -04:00

Add Panel to replace SidePanel and TopBottomPanel (#5659)

This combines `SidePanel` and `TopBottomPanel` into a single `Panel`.

The old types are still there as type aliases, but are deprecated.

`.min_width(…)` etc are now called `.min_size(…)` etc.

Again, the old names are still there, but deprecated.

(edited by @emilk)

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
Bruno Paré-Simard
2025-11-18 09:46:01 -05:00
committed by GitHub
parent 178f3c9198
commit 5b6a0196f9
20 changed files with 695 additions and 795 deletions

View File

@@ -9,7 +9,7 @@ fn main() -> eframe::Result {
let options = eframe::NativeOptions::default();
eframe::run_simple_native("My egui App", options, move |ctx, _frame| {
// A bottom panel to force the tooltips to consider if the fit below or under the widget:
egui::TopBottomPanel::bottom("bottom").show(ctx, |ui| {
egui::Panel::bottom("bottom").show(ctx, |ui| {
ui.horizontal(|ui| {
ui.vertical(|ui| {
ui.label("Single tooltips:");

View File

@@ -34,7 +34,7 @@ impl eframe::App for MyApp {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
ctx.all_styles_mut(|style| style.interaction.tooltip_delay = 0.0);
egui::SidePanel::left("side_panel_left").show(ctx, |ui| {
egui::Panel::left("side_panel_left").show(ctx, |ui| {
ui.heading("Information");
ui.label(
"This is a demo/test environment of the `UiStack` feature. The tables display \
@@ -82,7 +82,7 @@ impl eframe::App for MyApp {
});
});
egui::SidePanel::right("side_panel_right").show(ctx, |ui| {
egui::Panel::right("side_panel_right").show(ctx, |ui| {
egui::ScrollArea::both().auto_shrink(false).show(ui, |ui| {
stack_ui(ui);
@@ -170,7 +170,7 @@ impl eframe::App for MyApp {
});
});
egui::TopBottomPanel::bottom("bottom_panel")
egui::Panel::bottom("bottom_panel")
.resizable(true)
.show(ctx, |ui| {
egui::ScrollArea::vertical()