18 Commits
Author SHA1 Message Date
David MannandClaude Opus 5.5 eabac81511 Make next's CI green again: format, spelling, clippy, cargo-deny and the web demo build (#66)
* Make next's CI green again

The checks on `next` fail for every pull request, for reasons that have
nothing to do with the pull requests themselves:

- Format: rustfmt in two eframe web files, taplo in two manifests.
- Typos: British spellings; a test table of words cut into pieces is
  fenced off with `spellchecker:off`/`on`.
- Clippy with `-D warnings`: `map_or` with a call, a single-pattern
  `match`, needless borrows, the deprecated `Id::new` in a test, hash
  iteration in tests and the text_perf example, and a `dead_code`
  expectation that test builds don't fulfil.
- scripts/lint.py: blank lines, `#[inline]` on builder methods, and
  `core::iter::zip`/`chain` instead of `.zip(`/`.chain(`.
- cargo-deny: update tokio, url, rustls-webpki and webpki-roots past
  their advisories, allow the storytold/winit git source, and allow the
  path wildcard of egui_extras' egui_kittest dev-dependency.
- Web demo: eframe now has an inline JS snippet, which wasm-bindgen
  can't emit with `--no-modules`, so the demo and the wasm-bindgen check
  use `--target web` and the pages load it as an ES module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Use AsyncFd::register in the async example and refresh stale snapshots

tokio 1.54 deprecates `AsyncFd::new` (RUSTSEC-2026-0386), which fails the
example's clippy run under `-D warnings`. Register an owned duplicate of the
event loop's fd instead, as #46 does on main.

Eleven kittest snapshots no longer matched on the macOS runner: the pointer
arrow in the checkbox and button snapshots, a one-pixel tooltip edge, and the
right edge of the italics frame. They went stale while the test binaries did
not compile; this takes the runner's renders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix a broken intra-doc link in TextEditCursorPurpose

`cargo doc --document-private-items` with `-D warnings` can't resolve
`Self::preedit_range` on an enum variant's field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 21:33:01 -05:00
Emil Ernerfeldt 6aea7eff94 Enable the clippy::std_instead_of_core lint (#8394)
Prefer `core::` over `std::` where either work

* Part of https://github.com/emilk/egui/issues/5735
2026-08-06 13:19:13 +02:00
Emil ErnerfeldtandClaude Opus 5 b730815797 Update MSRV from 1.92 to 1.95 (#8348)
No particular reason

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 08:37:03 +00:00
Emil Ernerfeldt 27559ef3fd Rename Panel methods (#8192)
The three methods for showing a `Panel` are now:

* `panel.show`: always show the panel.
* `panel.show_collapsible`: show or hide the panel, with a slide
animation in between.
* `Panel::show_switched`: animate between two different panels: a
thin/collapsed one and a thick/expanded one.
2026-05-24 12:22:32 +02:00
Jasper Riedel 661d5f9173 Update MSRV from 1.88 to 1.92 (#7793) 2025-12-20 13:52:34 +01:00
Emil Ernerfeldt 8d98763fe1 Replace #[allow attributes with expect (#7796)
We do have `clippy::allow_attributes` turned on, but it doesn't seem to
work properly
2025-12-19 20:55:50 +01:00
Emil Ernerfeldt 7fe58bbfd4 Forbid uses of unwrap() in the code (#7795) 2025-12-19 20:34:18 +01:00
Emil Ernerfeldt 986c2c0ffb Use explicit Arc::clone to clarify when clones are cheap (#7784) 2025-12-17 17:19:18 +01:00
Emil Ernerfeldt 2f6fe9c572 eframe: Replace Frame::update with fn logic and fn ui (#7775)
* Part of https://github.com/emilk/egui/issues/5113
* Part of https://github.com/emilk/egui/issues/3524

## What
This deprecates `eframe::App::update` and replaces it with two new
functions:

```rs
pub trait App {
	/// Called just before `ui`, and in the future this will
    /// also be called for background apps when needed.
	fn logic(&mut self, ctx: &egui::Context, frame: &mut Frame) { }
	
    /// Show your user interface to the user.
	fn ui(&mut self, ui: &mut egui::Ui, frame: &mut Frame);

	…
}
```

Similarly, `Context::run` is deprecated in favor of `Context::run_ui`.

`Plugin`s are now handed a `Ui` instead of just a `Context` in
`on_begin/end_frame`.

## TODO
…either in this PR or a later one
* [x] Deprecate `App::update`
* [x] Deprecate `Context::run`
* [x] Change plugins to get a `Ui`
* [x] Update kittest
* [x] Change viewports to get UI:s (`show_viewport_immediate` etc)
  - https://github.com/emilk/egui/pull/7779

## Later PRs
* [ ] Deprecate `Panel::show`
* [ ] Deprecate `CentralPanel::show`
* [ ] Deprecate `CentralPanel` ?
2025-12-16 17:05:50 +01:00
Emil Ernerfeldt bfaf1b44f2 Replace ui.ctx().foo with ui.foo in a few places (#7774)
Internal code cleanup after
* https://github.com/emilk/egui/pull/7770
2025-12-14 17:12:10 +01:00
Emil Ernerfeldt d50287b83c Add taplo.toml for toml formatting (#7618) 2025-10-09 15:38:00 +02:00
Emil Ernerfeldt 843ceea90c Use more workspace dependencies (#7596) 2025-10-07 15:07:16 +02:00
Andreas ReichandEmil Ernerfeldt 4c1f344ef8 Update MSRV from 1.86 to 1.88 (#7579)
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2025-10-02 19:12:29 +02:00
Emil Ernerfeldt 531ead5ad1 Update MSRV to 1.86 (#7469) 2025-08-21 15:38:41 +02:00
Emil Ernerfeldt ef039aa566 Enable more clippy lints (#7418)
More is more!
2025-08-05 19:47:26 +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
Will BrownandWill Brown c075053391 Add external eventloop support (#6750)
<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to test and add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

* Closes #2875
* Closes https://github.com/emilk/egui/pull/3340
* [x] I have followed the instructions in the PR template

Adds `create_native`. Similiar to `run_native` but it returns an
`EframeWinitApplication` which is a `winit::ApplicationHandler`. This
can be run on your own event loop. A helper fn `pump_eframe_app` is
provided to pump the event loop and get the control flow state back.

I have been using this approach for a few months.

---------

Co-authored-by: Will Brown <opensource@rebeagle.com>
2025-04-29 12:09:23 +02:00