* Only show tooltips when mouse pointer is still
Revert to the old behavior by setting
`style.interaction.show_tooltips_only_when_still = false`.
* Area: take `impl Into<Id>`
* refactor tooltips
* Fix was_tooltip_open_last_frame
* Bug fix
* Add some spacing between tooltips
* Turn off optimization for debug builds again
* Optimize rect_contains_pointer
* Fix for colorpicker: make popup immovable
* Area: interact first
* ScrollArea: do interaction first
* Window: shrink double-clickable area of titelbar
* Only the top-most (latest added) interactive widget gets `hovered=true`
* Add Frame::total_margin
* Update changelog
* Add debug-options to visualize what widgets cover which other widget
* Using tracing-subscriber in hello_world example
* Add Key::Plus/Minus/Equals
* Warn if failing to guess OS from User-Agent
* Remove jitter when using Context::set_pixels_per_point
* Demo app: zoom in/out using ⌘+ and ⌘-
* Demo app: make backend panel GUI scale slider better
* Optimize debug builds a bit
* typo
* Update changelog
* Add helper module `egui::gui_zoom` for zooming an app
* Better names, and update changelog
* Combine Plus and Equals keys
* Last fix
* Fix docs
* Use total_cmp for clamping DragValue
* Added test for clamping
* Increase MSRV in all crates
* Increased rust version for github actions and lib.rs
* Inversed ranges are now working properply with clamp_to_range
* Added more tests
* 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
* 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
* Add API for querying the size of a panel
* demo app: animate backend panel collapse
* Add helper function for animating panels
* More animation functions
* Add line to changelog
* Added functionality to image.rs that allows for creating an image from rgb instead of just rgba
* remove "unmultiplied"
* remove "unmultiplied"
* rgba -> rgb
Co-authored-by: Mingun <Alexander_Sergey@mail.ru>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Co-authored-by: Mingun <Alexander_Sergey@mail.ru>
* using a shared vertex & index buffer in wgpu renderer
capacity each doubles when exceeded.
This change means a lot less allocation during egui's lifetime.
* changelog update
* minor code cleanup and changelog fix
* fix linter issue
* 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
* add a test suite demonstrating the issue
* fix false positives in RwLock, thus passing the new test suite
* friendler output
* augmented test suite with RWlock specifics (failing as expected!)
* full support for RWLocks
* implement support for guard remappings
* Add some newlines
* join `use` statements
* pass cranky
* addressing PR comments
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* Add ability to control double click reset in plot widget
* improve docstring
* small optimization
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* 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>
Closes https://github.com/emilk/egui/issues/2068
Before this PR, the default font, Ubuntu-Light, was ~11% smaller
than it should have been, and the default monospace font, Hack,
was ~14% smaller. This means that setting the font size `12` in egui
would yield smaller text than using that font size in any other app.
Ooops!
The change is that this PR now takes into account the ttf properties
`units_per_em` and `height_unscaled`.
If your egui application has specified you own font sizes or text styles
you will see the text in your application grow
larger, unless you go in and compensate by dividing all font sizes by
~1.21 for Ubuntu-Light/Proportional and ~1.16 for Hack/Monospace,
and with something else if you are using a custom font!
This effects any use of `FontId`, `RichText::size`, etc.
This PR changes the default `Style::text_styles` to compensate,
so the default egui style should look the same before and after this PR.
The Vivante GPU on many STM32MP1 based boards does not support sRGB
as an internal format.
Introduce a check for sRGB support and default to `RGBA8` internal format
if not supported.
Additionally the STM32MP1 needs to be checked for `GL_ARB_vertex_array_object`
Closes#1991
* Bug fix: reset repaint countdown when we pass it
* eframe: debug-print what winit event caused a repaint
* egui-winit: don't repaint when only moving window
* fix docstring
* Add `custom_parser` to `DragValue`
* Add `custom_parser` to `Slider`
* Add `binary_u64`, `octal_u64`, and `hexadecimal_u64` to `DragValue`
* Add `binary_u64`, `octal_u64`, and `hexadecimal_u64` to `Slider`
* Fix formatting and errors in docs
* Update CHANGELOG.md
* Fix CI errors
* Replace manual number parsing with i64::from_str_radix. Add support for signed integers.
* Update CHANGELOG.md
* Change documentation.
* Fix documentation.
* Fix documentation.
* Remove unnecessary links.
* egui_demo_app: remove wgpu and pollster as direct dependencies
* eframe: use same web-sys version as wgpu crate
* Make note that web_sys_unstable_apis is required by the wgpu crate
* Rename the glow web painter in eframe
* Remove trait DummyWebGLConstructor from web_glow_painter.rs
* cargo fmt
* Fix check.sh
* egui_extras: Add Table::vertical_scroll_offset
* Added example for TableBuilder::vertical_scroll_offset
* Format code
* Add link to PR in the changelog
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* Allow cursors to be linked
* Link cursors in demo
* Refactor cursor memory to deal with removal of plots
* Refactor PlotItem::on_hover to produce a list of cursors
* Use a separate `LinkedCursorsGroup` type to link cursors.
* Refactor `Cursor`.
* Inline `push_argument_ruler` and `push_value_ruler`.
* Update documentation
* Update doc reference
* 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
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()`.
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`.