emilk / emilk/egui

CentralPanel overflows in a window unless there is a Top, Bottom or Right pannel

Open
#901 2 comments 9 reactions 0 assignees View on GitHub
bug layout
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

If a CentralPanel is added to a window (with or without a LeftPanel), it seems to be ignored by the window layout and overflows. Adding a Top, Bottom or Right pannel makes the issue go away.

**Screenshots**
![image](https://user-images.githubusercontent.com/11248241/142274371-59066eec-8377-45da-af01-9b271fd08347.png)

**Expected behavior:** Window correctly wraps around central pannel and includes it in the layout. Window has no overflow.

**Desktop (please complete the following information):**
- OS: Ubuntu
- Version: tested on master
- Using eframe to run natively.

Code:

```rust
egui::Window::new("test").show(egui_context, |ui| {
// uncomment to make the issue go away

// egui::TopBottomPanel::top("top_panel").show_inside(ui, |ui| {
// egui::ScrollArea::vertical().show(ui, |ui| {
// lorem_ipsum(ui);
// });
// });

egui::SidePanel::left("left_panel").show_inside(ui, |ui| {
egui::ScrollArea::vertical().show(ui, |ui| {
lorem_ipsum(ui);
});
});

CentralPanel::default().show_inside(ui, |ui| {
ui.label("This guy is thinking outside the box for some reason")
})
});
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the provided egui::Window::show example, including the LeftPanel and CentralPanel but no Top, Bottom, or Right panel. Start by tracing Window::show, SidePanel::show_inside, and CentralPanel::show_inside, then verify that the window wraps the central panel without overflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.