From 5bcfc0a4a560d568dd7b51250dd9fd27b80590ce Mon Sep 17 00:00:00 2001 From: Elias Date: Fri, 9 Oct 2026 18:04:31 +0100 Subject: [PATCH] ui: elide long Project panel names with an ellipsis Names were hard-clipped mid-glyph against the label column ("EffectCraft Intrc"); use widgets::text_fit like the other text columns. (cherry picked from commit 341c924eff265f08e8b04b5a6a99d0d173a13e24) (cherry picked from commit 60086aa4b5c735cd2307d773b22d8189e211f40f) (cherry picked from commit c318f8438f60d5ecb8bbebb8857bad1fe6d9834d) (cherry picked from commit eaebbe7ce0b9d88970f435e9327f7b04612c1a9d) --- crates/ui-egui/src/panels/project.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/project.rs b/crates/ui-egui/src/panels/project.rs index e18f76bc..076be4f1 100644 --- a/crates/ui-egui/src/panels/project.rs +++ b/crates/ui-egui/src/panels/project.rs @@ -662,11 +662,14 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { let cell = Rect::from_min_max(pos2(x0 + 27.0, r.min.y + 1.0), pos2((x0 + 33.0 + g.size().x).min(name_clip.max.x), r.max.y - 1.0)); lp.with_clip_rect(name_clip.expand2(vec2(3.0, 0.0))).rect_filled(cell, 0.0, Color32::from_rgb(0xa6, 0xa6, 0xa6)); } - lp.with_clip_rect(name_clip).text( + // Long names end in "…" before the label column instead of being cut mid-glyph. + widgets::text_fit( + &lp.with_clip_rect(name_clip), pos2(x0 + 30.0, r.center().y), Align2::LEFT_CENTER, &it.name, Tokens::ui(12.0), + name_clip.max.x - (x0 + 30.0) - 2.0, if selected { Color32::from_gray(0x16) } else { t.text }, ); }