From 362d299642afb11b23336a41a30e6d93a2556490 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 10 Oct 2026 16:30:10 +0000 Subject: [PATCH] Fonts: No matching fonts goes through the interface catalog (#593 follow-up) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QiAJeFttZp83Fh7YuzAR5f --- crates/ui-egui/src/i18n/ui.rs | 4 ++++ crates/ui-egui/src/panels/text_panels.rs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/i18n/ui.rs b/crates/ui-egui/src/i18n/ui.rs index fdcaa27e6..9cb9d7365 100644 --- a/crates/ui-egui/src/i18n/ui.rs +++ b/crates/ui-egui/src/i18n/ui.rs @@ -320,6 +320,7 @@ const JAPANESE: &[(&str, &str)] = &[ ("No device list from this host; the system default output is used.", "このホストからはデバイス一覧を取得できないため、システムの既定の出力を使用します。"), ("No layer selected", "レイヤーが選択されていません"), ("No matching effects or presets", "一致するエフェクトまたはプリセットはありません"), + ("No matching fonts", "一致するフォントはありません"), ("No model credits were built into this copy.", "このビルドにはモデルのクレジットが含まれていません。"), ("No nested compositions", "ネストされたコンポジションはありません"), ("No shortcut", "ショートカットなし"), @@ -751,6 +752,7 @@ const SIMPLIFIED_CHINESE: &[(&str, &str)] = &[ ("No device list from this host; the system default output is used.", "此主机无法获取设备列表;将使用系统默认输出。"), ("No layer selected", "未选择图层"), ("No matching effects or presets", "没有匹配的效果或预设"), + ("No matching fonts", "没有匹配的字体"), ("No model credits were built into this copy.", "此副本未内置模型致谢。"), ("No nested compositions", "没有嵌套合成"), ("No shortcut", "无快捷键"), @@ -1242,6 +1244,7 @@ const TRADITIONAL_CHINESE: &[(&str, &str)] = &[ ("No device list from this host; the system default output is used.", "此主機無法獲取設備清單;將使用系統預設輸出。"), ("No layer selected", "未選取圖層"), ("No matching effects or presets", "沒有匹配的效果或預設集"), + ("No matching fonts", "沒有符合的字體"), ("No model credits were built into this copy.", "此副本未內置模型致謝。"), ("No nested compositions", "沒有嵌套合成"), ("No shortcut", "無快速鍵"), @@ -1729,6 +1732,7 @@ const UKRAINIAN: &[(&str, &str)] = &[ ), ("No layer selected", "Шар не виділено"), ("No matching effects or presets", "Не знайдено відповідних ефектів або наборів"), + ("No matching fonts", "Не знайдено відповідних шрифтів"), ("No model credits were built into this copy.", "Ця копія не містить відомостей про моделі."), ("No nested compositions", "Немає вкладених композицій"), ("No shortcut", "Немає клавіатурного скорочення"), diff --git a/crates/ui-egui/src/panels/text_panels.rs b/crates/ui-egui/src/panels/text_panels.rs index 2617ee85c..fa64860ae 100644 --- a/crates/ui-egui/src/panels/text_panels.rs +++ b/crates/ui-egui/src/panels/text_panels.rs @@ -645,7 +645,7 @@ pub(super) fn font_picker(app: &mut EffectcraftApp, ui: &mut egui::Ui, id: egui: } scroll.show(ui, |ui| { if filtered.is_empty() { - let r = ui.label("No matching fonts"); + let r = ui.label(tr("No matching fonts")); app.auto.add(&format!("{auto}.empty"), r.rect, "No matching fonts"); } let mut was_recent = false; @@ -655,7 +655,7 @@ pub(super) fn font_picker(app: &mut EffectcraftApp, ui: &mut egui::Ui, id: egui: } was_recent = r.recent; let row_width = ui.available_width(); - let label_width = if preview { row_width - 100.0 } else { row_width }; + let label_width = if preview { (row_width - 100.0).max(40.0) } else { row_width }; let resp = ui.add_sized([row_width, 24.0], egui::Button::selectable(index == state.selected, "")); resp.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::SelectableLabel, ui.is_enabled(), index == state.selected, &r.display)); let label_rect = Rect::from_min_size(resp.rect.min + vec2(5.0, 0.0), vec2(label_width - 5.0, resp.rect.height()));