Skip to content

Commit

Permalink
Improve spacing and alignment of menus (#5680)
Browse files Browse the repository at this point in the history
### What
Based on:
* emilk/egui#4232 
* emilk/egui#4230 
* emilk/egui#4233 

## Before
<img width="402" alt="Screenshot 2024-03-26 at 11 17 57"
src="https://github.com/rerun-io/rerun/assets/1148717/3a5f8d1d-ecff-49fe-8d7e-2a8a85289526">
<img width="581" alt="Screenshot 2024-03-26 at 11 17 40"
src="https://github.com/rerun-io/rerun/assets/1148717/fad07dd5-076a-4bf0-a8cd-dcb1369eddf8">

## After

<img width="599" alt="Screenshot 2024-03-26 at 11 20 36"
src="https://github.com/rerun-io/rerun/assets/1148717/dc4cc6d4-a117-4b6b-81b3-3fff6f64f247">

<img width="421" alt="Screenshot 2024-03-26 at 11 20 43"
src="https://github.com/rerun-io/rerun/assets/1148717/857b4767-17cd-4c23-8e28-4bd03881faed">

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/5680/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/5680/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/5680/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/5680)
- [Docs
preview](https://rerun.io/preview/003d45654e7ddf9335aa82d9c50d67dd5a0695c6/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/003d45654e7ddf9335aa82d9c50d67dd5a0695c6/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
  • Loading branch information
emilk authored Mar 26, 2024
1 parent 1f67220 commit 03db295
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,13 @@ debug = true
# As a last resport, patch with a commit to our own repository.
# ALWAYS document what PR the commit hash is part of, or when it was merged into the upstream trunk.

ecolor = { git = "https://github.com/emilk/egui.git", rev = "20b0637d42892b87fb8411b39c5c256fd32d7ee3" } # egui master 2024-03-22
eframe = { git = "https://github.com/emilk/egui.git", rev = "20b0637d42892b87fb8411b39c5c256fd32d7ee3" } # egui master 2024-03-22
egui = { git = "https://github.com/emilk/egui.git", rev = "20b0637d42892b87fb8411b39c5c256fd32d7ee3" } # egui master 2024-03-22
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "20b0637d42892b87fb8411b39c5c256fd32d7ee3" } # egui master 2024-03-22
egui_plot = { git = "https://github.com/emilk/egui.git", rev = "20b0637d42892b87fb8411b39c5c256fd32d7ee3" } # egui master 2024-03-22
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "20b0637d42892b87fb8411b39c5c256fd32d7ee3" } # egui master 2024-03-22
emath = { git = "https://github.com/emilk/egui.git", rev = "20b0637d42892b87fb8411b39c5c256fd32d7ee3" } # egui master 2024-03-22
ecolor = { git = "https://github.com/emilk/egui.git", rev = "8a10f81ca01b2ba4e0bd6e08d02fdd2063f1ddcc" } # egui master 2024-03-26
eframe = { git = "https://github.com/emilk/egui.git", rev = "8a10f81ca01b2ba4e0bd6e08d02fdd2063f1ddcc" } # egui master 2024-03-26
egui = { git = "https://github.com/emilk/egui.git", rev = "8a10f81ca01b2ba4e0bd6e08d02fdd2063f1ddcc" } # egui master 2024-03-26
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "8a10f81ca01b2ba4e0bd6e08d02fdd2063f1ddcc" } # egui master 2024-03-26
egui_plot = { git = "https://github.com/emilk/egui.git", rev = "8a10f81ca01b2ba4e0bd6e08d02fdd2063f1ddcc" } # egui master 2024-03-26
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "8a10f81ca01b2ba4e0bd6e08d02fdd2063f1ddcc" } # egui master 2024-03-26
emath = { git = "https://github.com/emilk/egui.git", rev = "8a10f81ca01b2ba4e0bd6e08d02fdd2063f1ddcc" } # egui master 2024-03-26

# Useful while developing:
# ecolor = { path = "../../egui/crates/ecolor" }
Expand Down
1 change: 1 addition & 0 deletions crates/re_ui/src/design_tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ fn apply_design_tokens(ctx: &egui::Context) -> DesignTokens {

egui_style.spacing.item_spacing = egui::vec2(8.0, 8.0);
egui_style.spacing.menu_margin = crate::ReUi::view_padding().into();
egui_style.spacing.menu_spacing = 1.0;

// avoid some visual glitches with the default non-zero value
egui_style.visuals.clip_rect_margin = 0.0;
Expand Down

0 comments on commit 03db295

Please sign in to comment.