Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS-like shadows with offset, spread, and blur #4232

Merged
merged 4 commits into from
Mar 26, 2024
Merged

Conversation

emilk
Copy link
Owner

@emilk emilk commented Mar 26, 2024

This makes epaint::Shadow more like CSS's box-shadow, adding offset and replacing extrusion with blur and spread.

The offsets make for nice drop-shadow effects.

Old shadows:
old-shadows

New shadows:
new-shadows-full

emilk added 2 commits March 26, 2024 09:06
Tweaks the default shadows for windows and popups to be smaller,
and with an offset
@emilk emilk added egui epaint style visuals and theming labels Mar 26, 2024
@emilk emilk merged commit c530504 into master Mar 26, 2024
35 checks passed
@emilk emilk deleted the emilk/css-shadow branch March 26, 2024 09:37
emilk added a commit to rerun-io/rerun that referenced this pull request Mar 26, 2024
### 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)
hacknus pushed a commit to hacknus/egui that referenced this pull request Oct 30, 2024
This makes `epaint::Shadow` more like CSS's box-shadow, adding `offset`
and replacing `extrusion` with `blur` and `spread`.

* Closes emilk#3047

The offsets make for nice drop-shadow effects.

Old shadows:
<img width="1447" alt="old-shadows"
src="https://github.com/emilk/egui/assets/1148717/8a30f7b9-fb9d-49ea-9a2f-9367a60c448a">

New shadows:
<img width="1447" alt="new-shadows-full"
src="https://github.com/emilk/egui/assets/1148717/28cc9c1e-b0de-4c5b-a705-22e52c556584">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui epaint style visuals and theming
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant