mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-14 19:27:05 -04:00
Merge pull request #825 from pravdomil/claude/footage-panel-double-click-e18b22
UI: wrap the Footage panel's empty hint in a narrow panel
This commit is contained in:
commit
d100e8af32
1 file changed
+6
-1
@@ -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;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user