* Add generations to serialized state
* Make IdTypeMap into a field struct
* Less code duplication
* Implement garbage collection during serialization
* Add unit-test
* Add docstring
* Build fix
* another fix
* Allow widget focus change with keyboard arrows
* remove set id function
* docs
* Emilk feedback round 1
* Fix compile error
* undo example
* Move out functions from range to memory.rs
* remove contains range
* Use docstrings
* code cleanup
* Improve candidate logic
* More tweaks
* Less `pub`
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
I encountered a case where I needed to know if an egui context menu was
open, even if the mouse cursor was not in an egui area (full details in
discord). I found that every resource I needed to detect that the menu
was open was either private, or pub(crate). While it is possible to
wrap the `Response::context_menu()` in code to do state-tracking, it
becomes necessary to duplicate that code in every place you use a
context menu.
In this commit, I add `Context::is_context_menu_open()`. Named similarly
to `Context::is_pointer_over_area()`, this method will return true if
any context menu is open. This is possible because the context menu
uses a temp var with a fixed Id to store its state. This method just
fetches the state, and interrogates it to see if there is a menu
present.
One helper method, `BarState::has_root()`, was added as all the fields
needed to perform the check were private to the `menu` module.
I've also updated the Context Menu demo to show the result of
`is_context_menu_open()` to verify the code functions as expected.
* Fix the app only taking up half the screen size on iPad
* Fix request_repaint not working on iOS
* Always use run_and_exit on iOS since run_and_return is not supported by winit on iOS right now.
* Fix typo
* Fix eframe glow on ios
* Handle more cases
* Add tooltip_delay option
Similar to the show_tooltips_only_when_still option, but allows the user
to configure a specific delay in seconds, and also makes the tooltip
disappear if the mouse is moved again.
Closes#3232
* Update crates/egui/src/response.rs
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* Improved wgpu callbacks
* update documentation on egui_wgpu callbacks
* make shared callback resource map pub
* make it nicer to create epaint::PaintCallback from egui_wgpu callback
* constrain ClippedPrimitive lifetime to outlive wgpu::RenderPass
* Revert callback resources to TypeMap, put finish_prepare on callback trait
* doc string fixes
* Add option to clip text to wrap width
* Spelling
* Better naming, and report back wether the text was elided
* Improve docstrings
* Simplify
* Fix max_rows with multiple paragraphs
* Add note
* Typos
* fix doclink
* Add `Label::elide`
* Label: show full non-elided text on hover
* Add demo of `Label::elide`
* Call it `Label::truncate`
* Clarify limitations of `break_anywhere`
* Better docstrings
We had a bunch of `cfg!(windows)` and `cfg!(macos)` which should
have been `cfg!(target_os = "windows")`.
I wonder what the effects of this PR will be fore Windows 😬
* Bump `wgpu` to 0.17.0
This required bumping wasm-bindgen to 0.2.87
* cargo deny exception for `foreign-types`
* sort deny.toml
* Add fragile-send-sync-non-atomic-wasm feature to wgpu
* cargo deny: ignore children of foreign-types
---------
Co-authored-by: Andreas Reich <r_andreas2@web.de>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* Fix the "ever-growing height" problem of Strip and Table Demos
Problem
-------
The height of "Table Demo" or "Strip Demo" floating window grows
when the demo app is interacted with. If 'Continuous' mode is enabled
in 'Backend' settings, the window grows irrespectively of user interaction.
Observations
------------
I noticed that [`area_content_ui.min_rect().max.y`][1] is increasing
monotonically with speed 0.5 px/frame.
I also noticed that commenting out `ui.add(crate::egui_github_link_file!());`
[statement][2] in `table_demo.rs` makes the problem disappear.
The "Fix"
---------
I added 0.5 to the height of the row with GitHub link.
This solved the problem.
Closes#3029.
Warning
-------
I failed to find the root cause of the problem.
I don't understand why this change makes the problem disappear.
[1]: 9478e50d01/crates/egui/src/containers/window.rs (L403)
[2]: 9478e50d01/crates/egui_demo_lib/src/demo/table_demo.rs (L114)
* Document `Rect::size`
Other changes:
- `area.rs`: Use existing API.
- `table_demo.rs`: Remove unnecessary call.
* implement save_plot
* fix for check.sh
* clippy
* add save_plot to Cargo.lock
* adapted for PR #2676 (removes unsafe code)
* add some comments
* implemented the comments from emilk
* update comments in code
* rustfmt
* remove picked_path
* add more comments
* removed unused import
* use `inner.response.rect` as the plot position
* remove plot_location from MyApp members
* sort entries
* Update examples/save_plot/src/main.rs
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* use env_logger instead of tracing subscriber
* use env_logger instead of tracing subscriber and combine if let
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>