From 3e0519de5f9436e7c0a6bcef277abcd2d07947c1 Mon Sep 17 00:00:00 2001 From: pravdomil <2387356+pravdomil@users.noreply.github.com> Date: Sun, 11 Oct 2026 15:38:55 +0200 Subject: [PATCH] UI: wrap the Footage panel's empty hint in a narrow panel Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/panels/footage_panel.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/footage_panel.rs b/crates/ui-egui/src/panels/footage_panel.rs index a8651464..a9e7cefb 100644 --- a/crates/ui-egui/src/panels/footage_panel.rs +++ b/crates/ui-egui/src/panels/footage_panel.rs @@ -19,7 +19,12 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { let p = ui.painter().with_clip_rect(rect); p.rect_filled(rect, 0.0, t.pasteboard); let Some(view) = app.session.state.footage_panel.clone() else { - p.text(rect.center(), Align2::CENTER_CENTER, tr("Double-click footage in the Project panel to open it here"), Tokens::ui(12.0), t.text_faint); + // Wrapped to the panel, so a narrow panel breaks the hint into lines instead of clipping it. + let hint = tr("Double-click footage in the Project panel to open it here"); + let mut job = egui::text::LayoutJob::simple(hint.to_owned(), Tokens::ui(12.0), t.text_faint, (rect.width() - 20.0).max(40.0)); + job.halign = egui::Align::Center; + let galley = p.layout_job(job); + p.galley(pos2(rect.center().x, rect.center().y - galley.size().y * 0.5), galley, t.text_faint); app.auto.add("footage.empty", rect, "Footage panel (empty)"); return; };