1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 22:30:03 -04:00

Add tags to UiStack (#4617)

You can now set custom tags on the `UiStack`. This allows you to write
code that is situationally aware at runtime. For instance, you could
decide wether or not a label should truncate its text depending on what
part of your ui it is in, without having to pass that info down via the
callstack.
This commit is contained in:
Emil Ernerfeldt
2024-06-05 18:46:50 +02:00
committed by GitHub
parent 321d2441c1
commit bb8400853f
6 changed files with 160 additions and 42 deletions

View File

@@ -547,7 +547,7 @@ fn ui_stack_demo(ui: &mut Ui) {
});
row.col(|ui| {
ui.label(if let Some(kind) = node.kind {
ui.label(if let Some(kind) = node.kind() {
format!("{kind:?}")
} else {
"-".to_owned()