bevy/examples/ui
LeshaInc 320ac65a9e
Replace DiagnosticId by DiagnosticPath (#9266)
# Objective

Implements #9216 

## Solution

- Replace `DiagnosticId` by `DiagnosticPath`. It's pre-hashed using
`const-fnv1a-hash` crate, so it's possible to create path in const
contexts.

---

## Changelog

- Replaced `DiagnosticId` by `DiagnosticPath`
- Set default history length to 120 measurements (2 seconds on 60 fps).

I've noticed hardcoded constant 20 everywhere and decided to change it
to `DEFAULT_MAX_HISTORY_LENGTH` , which is set to new diagnostics by
default. To override it, use `with_max_history_length`.


## Migration Guide

```diff
- const UNIQUE_DIAG_ID: DiagnosticId = DiagnosticId::from_u128(42);
+ const UNIQUE_DIAG_PATH: DiagnosticPath = DiagnosticPath::const_new("foo/bar");

- Diagnostic::new(UNIQUE_DIAG_ID, "example", 10)
+ Diagnostic::new(UNIQUE_DIAG_PATH).with_max_history_length(10)

- diagnostics.add_measurement(UNIQUE_DIAG_ID, || 42);
+ diagnostics.add_measurement(&UNIQUE_DIAG_ID, || 42);
```
2024-01-20 15:42:51 +00:00
..
borders.rs UI node outlines (#9931) 2023-10-05 12:10:32 +00:00
button.rs Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
display_and_visibility.rs Rename TextAlignment to JustifyText. (#10854) 2023-12-05 03:00:41 +00:00
flex_layout.rs UI examples clean up (#9479) 2023-08-23 12:49:10 +00:00
font_atlas_debug.rs Texture Atlas rework (#5103) 2024-01-16 13:59:08 +00:00
grid.rs Update default ClearColor to better match Bevy's branding (#10339) 2023-11-03 12:57:38 +00:00
overflow.rs Make clipped areas of UI nodes non-interactive (#10454) 2023-11-22 14:30:38 +00:00
overflow_debug.rs Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
relative_cursor_position.rs Camera-driven UI (#10559) 2024-01-16 00:39:10 +00:00
render_ui_to_texture.rs Restore brightness in the remaining three examples after exposure PR (#11389) 2024-01-17 17:10:21 +00:00
size_constraints.rs Rename TextAlignment to JustifyText. (#10854) 2023-12-05 03:00:41 +00:00
text.rs Replace DiagnosticId by DiagnosticPath (#9266) 2024-01-20 15:42:51 +00:00
text_debug.rs Replace DiagnosticId by DiagnosticPath (#9266) 2024-01-20 15:42:51 +00:00
text_wrap_debug.rs Change Window scale factor to f32 (adopted) (#10897) 2023-12-14 14:56:40 +00:00
transparency_ui.rs Have a separate implicit viewport node per root node + make viewport node Display::Grid (#9637) 2023-09-19 15:14:46 +00:00
ui.rs Update default ClearColor to better match Bevy's branding (#10339) 2023-11-03 12:57:38 +00:00
ui_material.rs Explicit color conversion methods (#10321) 2023-11-15 16:47:32 +00:00
ui_scaling.rs Update glam, encase and hexasphere (#11082) 2024-01-08 22:58:45 +00:00
ui_texture_atlas.rs Texture Atlas rework (#5103) 2024-01-16 13:59:08 +00:00
viewport_debug.rs Use default resolution for viewport_debug example (#9666) 2023-09-02 18:43:56 +00:00
window_fallthrough.rs Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
z_index.rs Have a separate implicit viewport node per root node + make viewport node Display::Grid (#9637) 2023-09-19 15:14:46 +00:00