Commit graph

33 commits

Author SHA1 Message Date
Emil Ernerfeldt
ae722ab0cf Release 0.21.0 - Deadlock fix and winit update 2023-02-08 20:11:21 +01:00
Emil Ernerfeldt
83b5b81227 Update changelogs with recent additions 2023-02-08 19:36:33 +01:00
Andreas Reich
b52cd2052f
Support for transparent backbuffer in wgpu winit binding (#2684)
* Support for transparent backbuffer in wgpu winit binding
Choose best fitting composite alpha mode on the fly.

* Compilation fix

* Add line to eframe CHANGELOG

* Attempt to mollify CI: try different way to install apt packages

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-02-06 14:16:17 +01:00
Emil Ernerfeldt
d15ce22e2e winit: Fix bug where the cursor could get stuck using the wrong icon 2023-02-05 08:48:40 +01:00
Emil Ernerfeldt
8344e88f8a
Update to to winit 0.28 (#2654)
* Update to winit 0.28

Mac trackpads pinch gestures will now generate `egui::Event::Zoom`

* Update accesskit_winit

* Try to get Android CI green

* Fix wayland compilation

* Add comment about android-activity

* Update changelogs

* Fix call to register_xlib_error_hook
2023-02-04 12:43:43 +01:00
Emil Ernerfeldt
e4eaf99072
Remove native screen reader support (#2669)
* Remove native screen reader support

Use the "accesskit" feature flag to `eframe` instead.
[AccessKit](https://github.com/AccessKit/accesskit) is the future.

`tts` was a mess to compile on many platforms, so I no longer want
the native `tts` dependency.

* Update tts to 0.25

* Update changelogs

* Turn on all feature flags for package.metadata.docs.rs

* remove tts from deny.toml skip-tree

* Update web build scripts

* Update deny.toml
2023-02-04 11:47:36 +01:00
Andreas Reich
8aa07e9d43
Clear color values are now explicitely sent to the rendering backend as-is. (#2666)
* Clear color values are not explicitely sent to the rendering backend as-is.
Previously, converting from Color32 to Rgba caused an srgb->linear conversion. This conversion is incorrect if the backbuffer doesn't perform automatic conversion from linear->srgb (lack of this conversion is generally what egui assumes!).

* fill in pr numbers in changelog

* Epi comment fix

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* Color32 comment fix

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* move changelog line

* rename fix

* use backticks in doc

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-02-04 11:02:15 +01:00
Emil Ernerfeldt
cd0f66b9ae
eframe web: ctrl-P and cmd-P will not open the print dialog (#2598) 2023-01-16 14:40:19 +01:00
Emil Ernerfeldt
cb77458f70
eframe error handling (#2433)
* eframe::run_native: return errors instead of crashing

* Detect and handle glutin errors

* egui_demo_app: silence wgpu log spam

* Add trace logs for why eframe is shutting down

* Fix: only save App state once on Mac

* Handle Winit failure

* Log where we load app state from

* Don't panic on zero-sized window

* Clamp loaded window size to not be too tiny to see

* Simplify code: more shared code in window_builder

* Improve code readability

* Fix wasm32 build

* fix android

* Update changelog
2022-12-12 15:16:32 +01:00
Emil Ernerfeldt
228f30ed46 Release 0.20.1 of eframe egui-winit egui_glium egui_glow - docs fixes 2022-12-11 17:04:23 +01:00
Emil Ernerfeldt
32606c2223
Fix docs.rs build issues for eframe, egui-winit, egui_glium, egui_glow (#2420)
* Fix docs.rs build issues for eframe, egui-winit, egui_glium, egui_glow

I hope we can get rid of the `tts` crate very soon,
now that AcessKit has landed. It is only used for web atm.
Should probably be removed from all native libraries.

* Update changelogs
2022-12-09 12:24:47 +01:00
Emil Ernerfeldt
85f615f21c Fix incorrect date in CHANGELOGs 2022-12-09 08:29:44 +01:00
Emil Ernerfeldt
7d91e90481 Release 0.20.0 - AccessKit, prettier text, overlapping widgets 2022-12-08 15:11:54 +01:00
Emil Ernerfeldt
8ae4d49e6e More changelog updates 2022-12-05 17:38:30 +01:00
Emil Ernerfeldt
aa503008ae Update changelogs with recent additions 2022-12-05 12:51:00 +01:00
Matt Campbell
e1f348e4b2
Implement accessibility APIs via AccessKit (#2294)
* squash before rebase

* Update AccessKit, introducing support for editable spinners on Windows and an important fix for navigation order on macOS

* Restore support for increment and decrement actions in DragValue

* Avoid VoiceOver race condition bug

* fix clippy lint

* Tell AccessKit that the default action for a text edit (equivalent to a click) is to set the focus. This matters to some platform adapters.

* Refactor InputState functions for AccessKit actions

* Support the AccessKit SetValue for DragValue; this is the only way for a Windows AT to programmatically adjust the value

* Same for Slider

* Properly associate the slider label with both the slider and the drag value

* Lazily activate egui's AccessKit support

* fix clippy lint

* Update AccessKit

* More documentation, particularly around lazy activation

* Tweak one of the doc comments

* See if I can get AccessKit exempted from the 'missing backticks' lint

* Make PlatformOutput::accesskit_update an Option

* Refactor lazy activation

* Refactor node mutation (again)

* Eliminate the need for an explicit is_accesskit_active method, at least for now

* Fix doc comment

* More refactoring of tree construction; don't depend on Arc::get_mut

* Override a clippy lint; I seem to have no other choice

* Final planned refactor: a more flexible approach to hierarchy

* Last AccessKit update for this PR; includes an important macOS DPI fix

* Move and document the optional accesskit dependency

* Fix comment typo

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* reformat

* More elegant code for conditionally creating a node

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* Set step to 1.0 for all integer sliders

* Add doc example for Response::labelled_by

* Clarify a TODO comment I left for myself

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-12-04 19:17:12 +01:00
Emil Ernerfeldt
eca5e6a4d2
Update to Rust 1.65 (#2314)
* Update to Rust 1.65

Because then you can use dynamic linking on Linux

* Fix a bunch of clippy lints

* Update changelogs

* More clippy fixes
2022-11-16 19:08:03 +01:00
Emil Ernerfeldt
eec18290a4
eframe: make sure to update native_pixels_per_point when dpi changes (#2256)
* eframe: make sure to update native_pixels_per_point when dpi changes

* Update changelog
2022-11-07 12:36:17 +01:00
Andreas Reich
4c82519fb8
configurable wgpu backend (#2207)
* introduce new wgpu configuration option to allow configuring wgpu renderer

* use new options with wgpu web painter

* use on_surface_error callback

* changelog update

* cleanup

* changelog and comment fixes
2022-10-31 17:57:32 +01:00
Emil Ernerfeldt
02b9d2d082
Keyboard shortcut helpers (#2202)
* eframe web: Add WebInfo::user_agent

* Deprecate `Modifier::ALT_SHIFT`

* Add code for formatting Modifiers and Key

* Add type KeyboardShortcut

* Code cleanup

* Add Context::os/set_os to query/set what OS egui believes it is on

* Add Fonts::has_glyph(s)

* Add helper function for formatting keyboard shortcuts

* Faster code

* Add way to set a shortcut text on menu buttons

* Cleanup

* format_keyboard_shortcut -> format_shortcut

* Add TODO about supporting more keyboard sumbols

* Modifiers::plus

* Use the new keyboard shortcuts in emark editor demo

* Explain why ALT+SHIFT is a bad modifier combo

* Fix doctest
2022-10-31 12:58:26 +01:00
Andreas Reich
c414af7aa2
wgpu renderer now always requires a RenderPass being passed in, pass command encoder to prepare callback (#2136)
* wgpu renderer now always requires a RenderPass being passed in
This also implies that it no longer owns the depth buffer! (why would it anyways!)

* wgpu-renderer now passes a command encoder to prepare

* add changelog entries

* fixup changelogs, fix variable name
2022-10-12 14:27:24 +02:00
Andreas Reich
c2a37f4bd8
eframe support for wgpu on the web (#2107)
* basic working wgpu @ webgl on websys

* fix glow compile error

* introduced WebPainter trait, provide wgpu renderstate

* WebPainterWgpu destroy implemented

* make custom3d demo work on wgpu backend

* changelog entry for wgpu support eframe wasm

* remove temporary logging hack

* stop using pollster for web
we're actually not allowed to block - this only worked because wgpu on webgl doesn't actually cause anything blocking. However, when trying webgpu this became an issue

* revert cargo update

* compile error if neither glow nor wgpu features are enabled

* code cleanup

* Error handling

* Update changelog with link

* Make sure --all-features work

* Select best framebuffer format from the available ones

* update to wasm-bindgen 0.2.83

* Fix typo

* Clean up Cargo.toml

* Log about using the wgpu painter

* fixup wgpu labels

* fix custom3d_wgpu_shader ub padding

* remove duplicated uniforms struct in wgsl shader for custom3d

* Update docs: add async/await to the web 'start' function

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-10-05 20:14:18 +02:00
Emil Ernerfeldt
2b0bf82b51
Make eframe::App::as_any_mut optional to implement (#2061) 2022-09-20 13:58:55 +02:00
Adia Robbie
bc6a823103
eframe: Add center to NativeOptions and monitor_size to WindowInfo (#2035)
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-09-17 11:20:40 +02:00
Paul Rouget
c4117066cf
MacOS: Support fullsize content (no titlebar, but window controls) (#2049)
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-09-16 14:31:21 +02:00
Emil Ernerfeldt
5500895845
eframe: make sure we save app state on Cmd-Q (#2013)
Cmd-Q emits a `winit::event::Event::LoopDestroyed` and then the app closes, without `run_return` returning (despite its name).
2022-09-06 16:07:58 +02:00
Adia Robbie
b43a8626cf
Add custom shader_version on glow renderer (#1993)
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-09-06 10:08:16 +02:00
Emil Ernerfeldt
d5933daee5 egui_glow: allow empty (zero-sized) textures
See https://github.com/emilk/egui/issues/1960
2022-08-24 14:34:34 +02:00
Robert Bragg
fb92434aac
Android support for EFrame (#1952)
* eframe: allow hooking into EventLoop building

This enables native applications to add an `event_loop_builder` callback
to the `NativeOptions` struct that lets them modify the Winit
`EventLoopBuilder` before the final `EventLoop` is built and run.

This makes it practical for applications to change platform
specific config options that Egui doesn't need to be directly aware of.

For example the `android-activity` glue crate that supports writing
Android applications in Rust requires that the Winit event loop be
passed a reference to the `AndroidApp` that is given to the
`android_main` entrypoint for the application.

Since the `AndroidApp` itself is abstracted by Winit then there's no
real need for Egui/EFrame to have a dependency on the `android-activity`
crate just for the sake of associating this state with the event loop.

Addresses: #1951

* eframe: defer graphics state initialization until app Resumed

Conceptually the Winit `Resumed` event signifies that the application is
ready to run and render and since
https://github.com/rust-windowing/winit/pull/2331 all platforms now
consistently emit a Resumed event that can be used to initialize
graphics state for an application.

On Android in particular it's important to wait until the application
has Resumed before initializing graphics state since it won't have an
associated SurfaceView while paused.

Without this change then Android applications are likely to just show
a black screen.

This updates the Wgpu+Winit and Glow+Winit integration for eframe but
it's worth noting that the Glow integration is still not able to fully
support suspend and resume on Android due to limitations with Glutin's
API that mean we can't destroy and create a Window without also
destroying the GL context, and therefore (practically) the entire
application.

There is a plan (and progress on) to improve the Glutin API here:
https://github.com/rust-windowing/glutin/pull/1435 and with that change
it should be an incremental change to enable Android suspend/resume
support with Glow later.

In the mean time the Glow changes keep the implementation consistent
with the wgpu integration and it should now at least be possible to
start an Android application - even though it won't be able to suspend
correctly.

Fixes #1951
2022-08-23 14:43:22 +02:00
Emil Ernerfeldt
97ce103209 Release 0.19.0 - wgpu backend, repaint_after, continue-after-close 2022-08-20 16:49:58 +02:00
Emil Ernerfeldt
127931ba45
eframe: rename quit/exit to "close" (#1943)
Since https://github.com/emilk/egui/pull/1919 we can continue
the application after closing the native window. It therefore makes
more sense to call `frame.close()` to close the native window,
instead of `frame.quit()`.
2022-08-20 16:08:59 +02:00
Emil Ernerfeldt
f4cc1c5465
eframe: Don't follow system theme by default (#1941)
I have gone back and forth on this a bit, but I think the arguments
AGAINST following the system theme are many:

* `dark-light` is a big dependency with problems on Linux.
* Many people prefer the dark mode and ask how to set it as the default
  (even though they are using light mode in their OS).
* A developer may be surprised when the app changes theme when
  they run it on another computer.

So, the path of least surprise is to make this an opt-in feature
with dark mode as the default mode.

On native, you add the `dark-light` feature to enable it.
On web, you set `WebOptions::follow_system_theme`.
2022-08-20 11:11:07 +02:00
Emil Ernerfeldt
041f2e64ba
Move all crates into a crates directory (#1940) 2022-08-20 10:41:49 +02:00
Renamed from eframe/CHANGELOG.md (Browse further)