1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 05:10:03 -04:00

rename comment & variable, add const root class for root ui

This commit is contained in:
adrien
2026-03-17 17:39:57 +01:00
parent fea172f315
commit b7e11af52e
3 changed files with 15 additions and 36 deletions

View File

@@ -49,7 +49,9 @@ fn main() -> eframe::Result {
while let Some(p) = parent {
text.push(format!(
"{}{}class : '{}', kind : {:?}",
" ".repeat((2 * 0_i32.max(i - 1)) as usize),
" ".repeat(
(2 * 0_i32.max(i - 1) + 1.min(i)) as usize
),
if i > 0 { "\\- " } else { "" },
p.classes,
p.kind()
@@ -58,7 +60,7 @@ fn main() -> eframe::Result {
parent = p.parent.as_ref();
}
ui.label(format!(
"Current hierarchy :\n{}",
"Current hierarchy (child to root):\n{}",
text.join("\n")
));
},