UI: wrap the Footage panel's empty hint in a narrow panel

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
pravdomilandClaude Opus 5.5 committed 2026-10-11 15:38:55 +02:00
1 parent 9a7d3e7699
commit 3e0519de5f
1 file changed
+6 -1
+6 -1
View File
@@ -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;
};