egui/egui_demo_lib/src/apps/demo
Emil Ernerfeldt 8e4fd942a9
Refactor memory data (#836)
This refactors the widget state storage introduced by @optozorax in https://github.com/emilk/egui/pull/257

* Unify the four buckets (`data`, `data_temp`, `id_data` and `id_data_temp`) into a single `data`.
  * Less complexity, and also less chance of error (storing in one bucket, reading from another).
* Store data by `Id` and `TypeId`.
  * Users can thus reuse the same `Id` to store many types.
  * Uses a simple xor of id and typeid, which is fast and good since both id and typeid are already high-entropy hashes.
* Use different suffixes on the functions to pick if you want the data persisted or not (`get_temp`, `insert_persisted`, etc).
  * Writing with one suffix and reading with the other works.
* To store state not bound to a specific `Id` (i.e. only based on type), use the new `Id::null` as the key.
2021-10-27 08:51:34 +02:00
..
app.rs End statements with semicolon (clippy::semicolon_if_nothing_returned) 2021-10-20 16:46:57 +02:00
code_editor.rs demo: add syntax_highlighting module with theme editor 2021-10-09 12:04:10 +02:00
code_example.rs Code example demo: remove extra ScrollArea 2021-10-23 15:36:25 +02:00
context_menu.rs Clean up some of the new context menus 2021-10-26 20:16:46 +02:00
dancing_strings.rs dancing_string demo: handle large input.time 2021-10-24 18:38:44 +02:00
demo_app_windows.rs Context menus (#543) 2021-10-26 19:55:42 +02:00
drag_and_drop.rs Context menus (#543) 2021-10-26 19:55:42 +02:00
font_book.rs code cleanup: use Trait as _; 2021-10-09 12:04:10 +02:00
layout_test.rs code cleanup: use Trait as _; 2021-10-09 12:04:10 +02:00
misc_demo_window.rs Replace every ... with … like some sort of crazy person 2021-10-13 11:52:34 +02:00
mod.rs Context menus (#543) 2021-10-26 19:55:42 +02:00
multi_touch.rs use map_or and map_or_else 2021-10-20 16:46:57 +02:00
painting.rs code cleanup: use Trait as _; 2021-10-09 12:04:10 +02:00
password.rs Refactor memory data (#836) 2021-10-27 08:51:34 +02:00
plot_demo.rs Use for-loop instead of Iterator::for_each 2021-10-20 16:46:57 +02:00
scrolling.rs implement stick-to-end scroll (#765) 2021-10-09 12:59:42 +02:00
sliders.rs code cleanup: use Trait as _; 2021-10-09 12:04:10 +02:00
tests.rs code cleanup: use Trait as _; 2021-10-09 12:04:10 +02:00
toggle_switch.rs Improve widget info output for potential screen readers 2021-03-08 18:36:32 +01:00
widget_gallery.rs Context menus (#543) 2021-10-26 19:55:42 +02:00
window_options.rs Context menus (#543) 2021-10-26 19:55:42 +02:00
window_with_panels.rs code cleanup: use Trait as _; 2021-10-09 12:04:10 +02:00