From 6252dc37374195390f51900afc06f4f882d0a7f6 Mon Sep 17 00:00:00 2001 From: con3code Date: Sun, 11 Oct 2026 01:31:25 +0900 Subject: [PATCH] UI: the welcome screen's Discord button clears the text beside it The community card is wider and its text wraps before the button's space, so a longer translation of the line under the title no longer runs under the button. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013phQ3ekq6uGBEWD6FjFYG2 --- crates/ui-egui/src/chrome.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/chrome.rs b/crates/ui-egui/src/chrome.rs index 2896fcdc..4ae29198 100644 --- a/crates/ui-egui/src/chrome.rs +++ b/crates/ui-egui/src/chrome.rs @@ -722,12 +722,18 @@ pub fn start_screen(app: &mut DesignApp, ui: &mut egui::Ui) { fn community_card(app: &mut DesignApp, ui: &mut egui::Ui) { let t = Tokens::get(ui.ctx()); egui::Frame::NONE.fill(t.panel).corner_radius(10.0).inner_margin(egui::Margin::same(14)).show(ui, |ui| { - ui.set_max_width(640.0); + // Wide enough for the longer translations of the line under the title, with the button + // at the right edge; the text wraps before the button's space rather than run under it. + const BUTTON: egui::Vec2 = vec2(190.0, 38.0); + ui.set_max_width(760.0); ui.horizontal(|ui| { let (r, _) = ui.allocate_exact_size(vec2(44.0, 44.0), Sense::hover()); crate::about::paint_mark(ui, r, crate::about::BRAND); ui.add_space(8.0); + let text_width = (ui.available_width() - BUTTON.x - 16.0).max(120.0); ui.vertical(|ui| { + ui.set_max_width(text_width); + ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Wrap); ui.label(crate::rtl::widget( ui, egui::RichText::new(crate::i18n::tr(&app.ui.language, "Join the ArtCraft community")).font(semibold(14.0)).color(t.text_strong), @@ -754,7 +760,7 @@ fn community_card(app: &mut DesignApp, ui: &mut egui::Ui) { }); }); ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { - if crate::about::discord_button(ui, crate::i18n::tr(&app.ui.language, "Join our Discord"), vec2(190.0, 38.0)) { + if crate::about::discord_button(ui, crate::i18n::tr(&app.ui.language, "Join our Discord"), BUTTON) { let _ = app.run("help.discord", json!({})); } });