Commit Graph
100 Commits
Author SHA1 Message Date
Emil Ernerfeldt 74dce787af Hide scroll bars when dragging other things (#7689)
This closes a small visual glitch where scroll bars would show up when
dragging something unrelated, like a slider or a panel side.
2025-11-13 11:53:50 +01:00
Emil Ernerfeldt 0b9bb5f494 Make sure native_pixels_per_point is set during app creation (#7683)
Useful for things like analytics
2025-11-13 11:53:50 +01:00
Emil Ernerfeldt 9253acd7f3 Fix edge cases in "smart aiming" in sliders (#7680)
When dragging slider, we try to pick nice, round values. There were a
couple edge cases there that were handled wrong. This is now fixed.
2025-11-13 11:53:50 +01:00
Emil Ernerfeldt ea14da142a Release egui_kittest 0.33.1 2025-11-13 11:47:53 +01:00
Emil ErnerfeldtandLucas Meurer 9f5b797375 Add egui_kittest::Harness::set_options (#7638)
Makes it easier to set the same options for many tests

---------

Co-authored-by: Lucas Meurer <hi@lucasmerlin.me>
2025-11-13 11:47:53 +01:00
Emil Ernerfeldt 7d33442ca1 Fix kerning snapshot test directory 2025-11-13 11:47:25 +01:00
Emil Ernerfeldt d50287b83c Add taplo.toml for toml formatting (#7618) 2025-10-09 15:38:00 +02:00
Emil ErnerfeldtandCopilot 82b6b3c98d Tweak Rust Analyzer settings (#7617)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-09 12:56:57 +02:00
Emil Ernerfeldt 9e13889589 Revert wasm-bindgen to 0.2.100 (#7612) 2025-10-09 08:56:33 +02:00
Emil Ernerfeldt 94f2ed6334 Do not lock wasm-bindgen version (#7609) 2025-10-08 17:09:04 +02:00
Emil Ernerfeldt 47a437403f Use software texture filtering in kittest (#7602) 2025-10-08 16:24:02 +02:00
Emil Ernerfeldt 4d4f90eb31 kittest: No debug_open_snapshot on wasm (#7606) 2025-10-08 11:47:34 +02:00
Emil Ernerfeldt 6a49c9ad6b Unwind minimum home version 2025-10-08 10:44:44 +02:00
Emil Ernerfeldt 0d47abcaa0 Better docs + deprecation for screen/content/viewport_rect (#7605) 2025-10-08 10:43:11 +02:00
Emil Ernerfeldt 683214bfe8 Add kittest snapshot test of italics (#7603) 2025-10-07 17:22:31 +02:00
Emil Ernerfeldt 9cb4e6a54e Create egui_wgpu::RendererOptions (#7601) 2025-10-07 17:06:23 +02:00
Emil Ernerfeldt 56b1def064 Update to the latest dependencies (#7599) 2025-10-07 16:26:13 +02:00
Emil Ernerfeldt 86dc9ea64e Inline log format args (#7600) 2025-10-07 16:14:43 +02:00
Emil Ernerfeldt ac4e04d0b8 cargo upgrade (#7598) 2025-10-07 15:30:00 +02:00
Emil Ernerfeldt 843ceea90c Use more workspace dependencies (#7596) 2025-10-07 15:07:16 +02:00
Emil Ernerfeldt ab461f4115 Fix eframe window not being focused on mac on startup (#7593)
* Workaround for https://github.com/rust-windowing/winit/issues/4371
* Closes https://github.com/emilk/egui/issues/7588

Tested manually
2025-10-07 14:21:10 +02:00
Emil Ernerfeldt 78fffc7707 clean up the clippy.toml:s (#7594) 2025-10-07 14:12:51 +02:00
Emil Ernerfeldt 0281b95bd9 CI: use latest typos (#7595) 2025-10-07 14:12:30 +02:00
Emil ErnerfeldtandCopilot 096ed1c0cb Replace cargo check with cargo clippy on ci (#7581)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-02 20:19:23 +02:00
Emil Ernerfeldt 6579bb910b Remove log feature (#7583) 2025-10-02 20:09:48 +02:00
Emil Ernerfeldt bd45406fad Use a lot more let-else (#7582) 2025-10-02 19:47:00 +02:00
Emil ErnerfeldtandAndreas Reich 18ea9ff0bd Warn if DYLD_LIBRARY_PATH is set and we find no wgpu adapter (#7572)
Co-authored-by: Andreas Reich <andreas@rerun.io>
2025-09-30 15:56:04 +02:00
Emil Ernerfeldt 4fb4072ce8 Adjust when we write .diff and .new snapshot images (#7571) 2025-09-30 15:51:46 +02:00
Emil Ernerfeldt 5ee88da61c kittest: Format errors with Display (#7569) 2025-09-30 08:24:21 +02:00
Emil Ernerfeldt e9898e4932 Improve error message when failing to run egui_demo_app (#7567) 2025-09-29 11:12:03 +02:00
Emil Ernerfeldt 4683d91653 Small clippy fixes (#7566) 2025-09-27 12:14:47 +02:00
Emil Ernerfeldt 472437a510 Small CI improvements (#7563) 2025-09-26 09:39:42 +02:00
Emil Ernerfeldt 6ac155c5cd eframe web: prevent default action on command-comma (#7547) 2025-09-17 08:12:50 +02:00
Emil Ernerfeldt 603dba29e6 Add snapshot test for text spacing/kerning (#7545) 2025-09-16 13:30:28 +02:00
Emil Ernerfeldt 226bdc4c5b 0.32.3 release: Bump version numbers and update changelog (#7536) 2025-09-12 08:18:19 +02:00
Emil Ernerfeldt 802d307e4a Remove deprecated fields from PlatformOutput (#7523) 2025-09-09 16:07:39 +02:00
Emil Ernerfeldt 72b9b9d750 Increase default text size from 12.5 to 13.0 (#7521) 2025-09-09 15:47:24 +02:00
Emil Ernerfeldt c2912369ca Improve text demo: more fine control of letter spacing (#7520) 2025-09-09 09:35:25 +02:00
Emil Ernerfeldt 01ee23c1a0 Add Zoom Factor to options panel (#7517) 2025-09-08 18:27:28 +02:00
Emil Ernerfeldt b822977e7f Remove preload_font_glyphs flag (#7516) 2025-09-08 18:17:55 +02:00
Emil Ernerfeldt 9cc7f2ec16 Improve deadlock detection output (#7515) 2025-09-08 17:37:49 +02:00
Emil Ernerfeldt aedd43c88f kittest: Add UPDATE_SNAPSHOTS=force (#7508)
This adds a new mode, `UPDATE_SNAPSHOTS=force`, which will lower the
threshold to zero, overwriting every image that is not _exactly_ the
same.

Most comparisons has a threshold because different GPUs render slightly
differently. However, setting that threshold accurately can be hard.

Sometimes a test will pass locally, but fail on CI. In those cases you
want to force an update of the failing test. You can use
`UPDATE_SNAPSHOTS=force` for that.

And sometimes a small change _should_ update all images, but the change
is so tiny that it falls under the threshold. Still, you want to make a
point of showing that these images have changes. You can use
`UPDATE_SNAPSHOTS=force` for that.
2025-09-05 16:45:36 +02:00
Emil Ernerfeldt eceb0b11c9 Document how to push git lfs files to 3rd party PRs (#7507) 2025-09-05 10:47:23 +02:00
Emil Ernerfeldt 4947b191e4 Make more dependencies workspace dependencies (#7495) 2025-09-04 09:54:59 +02:00
Emil Ernerfeldt 0fad7d8503 Enable more clippy lints (#7474) 2025-08-24 16:27:28 +02:00
Emil Ernerfeldt 608de4a264 Update bytemuck (#7475) 2025-08-24 16:27:21 +02:00
Emil Ernerfeldt a5a51ced0f Improve egui-winit profile scope 2025-08-24 15:03:57 +02:00
Emil Ernerfeldt 5453cceded Use official cargo machete action (#7470) 2025-08-21 15:42:10 +02:00
Emil Ernerfeldt 531ead5ad1 Update MSRV to 1.86 (#7469) 2025-08-21 15:38:41 +02:00
Emil Ernerfeldt 1da1d57c11 Panic mutexes that can't lock for 30 seconds, in debug builds (#7468)
I'm trying to debug a suspected deadlock in the CI for
https://github.com/emilk/egui/pull/7467

Since we use our own mutex wrappers, we can just panic if the lock is
too slow. Ugly and effective :)
2025-08-21 15:31:56 +02:00
Emil Ernerfeldt 7c5798289d Bump version numbers to 0.32.1 2025-08-15 13:43:27 +02:00
Emil Ernerfeldt 6a355c3808 Add 0.32.1 to changelogs 2025-08-15 13:42:49 +02:00
Emil Ernerfeldt b24a56d3f7 Only update snapshot if we didn't pass (#7455)
* Closes https://github.com/emilk/egui/issues/7449
2025-08-15 12:21:51 +02:00
Emil Ernerfeldt 839ee3eaf7 Make sure we always track the root viewport (#7450)
Some sanity checks I added while working on another bug
2025-08-14 12:03:38 +02:00
Emil Ernerfeldt 42bdf5b881 Fix link checker CI (#7308) 2025-08-12 12:34:53 +02:00
Emil Ernerfeldt 6fae65a3fa Add emath::fast_midpoint (#7435) 2025-08-08 12:04:51 +02:00
Emil Ernerfeldt 3024c39eaf Enable and fix some more clippy lints (#7426)
One can never have too many lints
2025-08-08 09:57:53 +02:00
Emil Ernerfeldt 36a4981f29 Enable clippy::iter_over_hash_type lint (#7421)
This helped discover a few things that _might_ have been buggy.
2025-08-06 13:55:53 +02:00
Emil Ernerfeldt d42ea3800f Update to winit 0.30.12 (#7420) 2025-08-06 13:53:59 +02:00
Emil Ernerfeldt c8e6f6bfe5 Remove deprecated clippy lint 2025-08-06 11:45:02 +02:00
Emil Ernerfeldt ef039aa566 Enable more clippy lints (#7418)
More is more!
2025-08-05 19:47:26 +02:00
Emil Ernerfeldt b9a5081490 Fix glyph rendering: clamp coverage to [0, 1] (#7415)
* Closes  #7366
* Closes https://github.com/emilk/egui/pull/7388
2025-08-05 13:03:39 +02:00
Emil Ernerfeldt fdcaff8465 Improve RELEASES.md 2025-07-10 17:06:31 +02:00
Emil Ernerfeldt fabd4aa7a5 Release 0.32.0 - Atoms, popups, and better SVG support (#7329) 2025-07-10 16:58:39 +02:00
Emil Ernerfeldt 9478a6223b Rename egui::containers::menu::Bar to egui::MenuBar (#7327)
The old name is still there, just deprecated.
2025-07-10 10:33:48 +02:00
Emil Ernerfeldt 8d2f39fc08 Improve release checklist (#7322)
* See https://github.com/emilk/egui/issues/7321
2025-07-09 19:36:38 +02:00
Emil Ernerfeldt a7f14ca176 Deprecate Memory::popup API in favor of new Popup API (#7317)
* Closes  #7037
* Closes #7297

This deprecates all popup-related function in `Memory`, replacing them
with the new `egui::Popup`.

The new API is nicer in all ways, so we should encourage people to use
it.
2025-07-09 12:55:06 +02:00
Emil Ernerfeldt fbe0aadf63 Add Popup::from_toggle_button_response (#7315)
Adds a convenience constructor for `Popup`
2025-07-09 10:12:47 +02:00
Emil ErnerfeldtandAdrian Blumer f46926aaf1 Improve texture filtering by doing it in gamma space (#7311)
* Closes https://github.com/emilk/egui/pull/5839

This makes some transparent images look a lot nicer when blended:


![image](https://github.com/user-attachments/assets/7f370aaf-886a-423c-8391-c378849b63ca)

Cursive text will also look nicer.

This unfortunately changes the contract of what
`register_native_texture` expects

---------

Co-authored-by: Adrian Blumer <blumer.adrian@gmail.com>
2025-07-07 17:46:27 +02:00
Emil Ernerfeldt dd1052108e Add snapshot test for image blending (#7309)
This adds a test that can be used to see the improvements made by this
PR (if any):
* https://github.com/emilk/egui/pull/5839
2025-07-07 13:58:22 +02:00
Emil Ernerfeldt 09596a5e7b egui_kittest: more ergonomic functions taking Impl Into<String> (#7307) 2025-07-07 13:50:53 +02:00
Emil Ernerfeldt b11b77e85f Save a few CPU cycles with earlier early-out from Popup::show (#7306) 2025-07-07 12:07:13 +02:00
Emil Ernerfeldt 933d305159 Improve doc-string for Image::alt_text 2025-07-07 12:06:59 +02:00
Emil Ernerfeldt 93d562221b Change Rect::area to return zero for negative rectangles (#7305)
Previously a single-negative rectangle (where `min.x > max.x` XOR `min.y
> max.y`) would return a negative area, while a doubly-negative
rectangle (`min.x > max.x` AND `min.y > max.y`) would return a positive
area. Now both return zero instead.
2025-07-07 12:03:03 +02:00
Emil Ernerfeldt 3622a03a46 Mark Popup with #[must_use] 2025-07-07 12:02:51 +02:00
Emil Ernerfeldt 6d80707422 Fix tooltips sometimes changing position each frame (#7304)
There was a bug in how we decide where to place a `Tooltip` (or other
`Popup`), which could lead to tooltips jumping around every frame,
especially if it changed size slightly.

The new code is simpler and bug-free.
2025-07-07 12:02:01 +02:00
Emil Ernerfeldt a811b975c2 Better deprecation of SelectableLabel 2025-07-07 09:33:08 +02:00
Emil Ernerfeldt d94386de3d Fix debug_assert triggered by menu/intersect_ray (#7299) 2025-07-04 09:55:03 +02:00
Emil Ernerfeldt ba577602a4 Fix crash when using infinite widgets (#7296)
* Closes https://github.com/emilk/egui/issues/7100
2025-07-03 13:40:02 +02:00
Emil Ernerfeldt 378e22e6ec Improve the ThemePreference selection UI slightly 2025-07-03 09:16:13 +02:00
Emil Ernerfeldt 40c69cd1ba Respect and detect prefers-color-scheme: no-preference (#7293)
I don't think this will make a difference in practice, but technically
there are three preference states:

* `dark`
* `light`
* `no-preference`

Previously we would only check for `dark`, and if not set would assume
`light`.
Not we also check `light` and if we're neither `dark` or `light` we
assume nothing.
2025-07-03 08:58:45 +02:00
Emil Ernerfeldt dc79998044 Improve text rendering in light mode (#7290)
This changes how we convert glyph coverage to alpha (and ultimately a
color), but only in light mode.

This is a bit of a hack, because it doesn't fix dark-on-light text in
_dark mode_ (if you have any), but for the common case this PR is a huge
improvement.

You can also tweak this yourself now using
`Visuals::text_alpha_from_coverage` or from the UI (bottom of the
image):


![image](https://github.com/user-attachments/assets/350210d4-c0bb-44b6-84cc-47c2e9d4b9f0)



## Before / After

![widget_gallery_light_x1](https://github.com/user-attachments/assets/21f5a2a0-6b4e-4985-b17f-cd1c7cc01b46)
![widget_gallery_light_x1](https://github.com/user-attachments/assets/5dfec04a-c81c-43ef-8d86-fc48ef7958f1)


## Black text Before/after
If you think the text above looks too weak, it's only because of the
default text color. Here's how it looks like with perfectly `#000000`
black text:


![image](https://github.com/user-attachments/assets/56a4a4f3-c431-4991-b941-a566a4ae94ed)
![Screenshot 2025-07-02 at 13 59
30](https://github.com/user-attachments/assets/df5a91ad-0bb8-4a0f-81a2-50852e7556c1)
2025-07-02 14:58:37 +02:00
Emil Ernerfeldt 8bedaf6e5b Add light-mode Widget Gallery screenshot test (#7288)
Part of some work to improve text rendering in light mode (again!)
2025-07-02 12:00:36 +02:00
Emil Ernerfeldt 22c6a9ae69 egui_kittest: Add HarnessBuilder::theme (#7289)
Makes it ergonomic to snapshot test light vs dark mode
2025-07-02 12:00:22 +02:00
Emil Ernerfeldt 0857527f1d Add Visuals::weak_text_alpha and weak_text_color (#7285)
* Closes https://github.com/emilk/egui/issues/7262

This also makes the default weak color slightly less weak in most cases.
2025-07-01 20:42:54 +02:00
Emil Ernerfeldt 9d1dce51eb Extend .typos.toml to enforce american english (#7284)
More or less the same list we use at Rerun
2025-07-01 15:54:00 +02:00
Emil Ernerfeldt 737c61867b Add Visuals::text_edit_bg_color (#7283)
* Closes https://github.com/emilk/egui/issues/7263
2025-07-01 15:13:16 +02:00
9e021f78da Change ui.disable() to modify opacity (#7282)
* Closes https://github.com/emilk/egui/pull/6765


Branched off of https://github.com/emilk/egui/pull/6765 by @tye-exe.

I needed to branch off to update snapshot images

---------

Co-authored-by: tye-exe <tye@mailbox.org>
Co-authored-by: Tye <131195812+tye-exe@users.noreply.github.com>
2025-07-01 14:05:53 +02:00
Emil Ernerfeldt b2995dcb83 Use Rust edition 2024 (#7280) 2025-06-30 14:01:57 +02:00
Emil Ernerfeldt 962c8e26a8 Update MSRV to 1.85 (#7279) 2025-06-30 13:43:27 +02:00
Emil Ernerfeldt 8ba42f322d Add Context::cumulative_frame_nr (#7278) 2025-06-30 13:29:56 +02:00
Emil Ernerfeldt d770cd53a6 Add Context::current_pass_index (#7276)
This can be used by developers who wants to add diagnostics when there
is a multi-pass egui frame.
2025-06-30 10:41:27 +02:00
Emil Ernerfeldt 2525546fef Simplify some bezier math 2025-06-30 10:03:54 +02:00
Emil Ernerfeldt ae8363ddb5 eframe web: only cosume copy/cut events if the canvas has focus (#7270)
Previously eframe would "steal" these events (by calling
`stop_propagation/prevent_default`) even when the eframe canvas did not
have focus.
2025-06-27 10:25:47 +02:00
Emil Ernerfeldt 8c2df4802c Add back old Tooltip::new (#7156)
I was a bit too hasty in https://github.com/emilk/egui/pull/7151 and
changed a public API in a breaking way, for no good reason
2025-06-16 19:36:19 +02:00
Emil Ernerfeldt 06760e1b08 Change API of Tooltip slightly (#7151)
We try to be consistent with our parameter order to reduce surprise for
users.

I also renamed a few things to clarify what is what
2025-06-16 08:30:46 +02:00
Emil Ernerfeldt 699be07978 Add Vec2::ONE 2025-06-15 18:01:58 -07:00
Emil Ernerfeldt f0abce9bb8 Button inherits the alt_text of the Image in it, if any (#7136)
If a `Button` has an `Image` in it (and no text), then the
`Image::alt_text` will be used as the accessibility label for the
button.
2025-06-11 23:00:59 +02:00
Emil Ernerfeldt bdbe655852 Mark HarnessBuilder build functions with #[must_use] 2025-06-07 17:19:12 -07:00
Emil Ernerfeldt b8dfb138b6 Remove outdated link in README 2025-06-07 10:24:41 -07:00