emilk / emilk/egui

Menu bar buttons have too much space on the bottom

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

Description

**Describe the bug**

Buttons in the menu bar have more padding between the bottom of the menu bar and the button, than between the top of the menu bar and the button.

**To Reproduce**
Steps to reproduce the behavior:

```rs
egui::TopBottomPanel::top(0).show(ctx, |ui| {
egui::menu::bar(ui, |ui| {
ui.menu_button("All", |ui| {
if ui.button("Quit").clicked() {
quit = true;
}
});
});
});
```

**Expected behavior**

There should be equal amount of space on the top and bottom of menu buttons.

**Screenshots**

![grim_1665335099](https://user-images.githubusercontent.com/99364286/194769992-5216feb7-6234-49bf-a196-34048d952cb9.png)

![grim_1665335327](https://user-images.githubusercontent.com/99364286/194770131-514b4079-554d-4e91-a3cf-a7165b3be2fb.png)

**Desktop:**
- OS: Linux, Wayland
- Browser: N/A
- Version: 5.19.3

Contributor guide

Open the contributing guide

Research direction

Reproduce the spacing issue with the shown TopBottomPanel and egui::menu::bar snippet, checking the current master version as requested in the report. Start at the menu bar and button layout entry points, then verify that the top and bottom spacing are equal in the resulting UI.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.