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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user