From 8b1e37e0da97a48e45dda4777903e7fae4dc95c1 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 25 Jun 2026 14:11:06 +0300 Subject: [PATCH] fix(web): render OSNAP tooltip caret as SVG, not a tofu glyph (#138) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The OSNAP settings tooltip read "Click ▾"; the ▾ (U+25BE) is absent from the web font and showed as a tofu box. Tooltips are plain text and can't embed SVG, so add a rich-body tooltip variant (tip_node) and use the existing SVG caret (icons::arrow_down) — consistent with the SVG-icon approach the rest of the chrome already uses for the web. Co-Authored-By: Claude Opus 4.8 --- src/ui/statusbar.rs | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/ui/statusbar.rs b/src/ui/statusbar.rs index 8ce4fed36..86a35cde0 100644 --- a/src/ui/statusbar.rs +++ b/src/ui/statusbar.rs @@ -1,7 +1,7 @@ //! Bottom status bar — Model/Layout tabs + OSNAP toggle + status info use iced::widget::tooltip::Position as TipPos; -use iced::widget::{button, container, mouse_area, row, text, text_input, tooltip, Row}; +use iced::widget::{button, column, container, mouse_area, row, text, text_input, tooltip, Row}; use iced::{Background, Border, Color, Element, Length, Theme}; /// Widget id of the inline layout-rename text input, so the rename can grab @@ -291,9 +291,16 @@ fn customize_btn() -> Element<'static, Message> { // ── Tooltip helper ──────────────────────────────────────────────────────── fn tip<'a>(content: Element<'a, Message>, label: &'static str) -> Element<'a, Message> { + tip_node(content, text(label).size(11).color(Color::WHITE).into()) +} + +/// Like [`tip`] but the tooltip body is any element — used to embed an SVG +/// glyph (e.g. the dropdown caret) instead of a Unicode character that renders +/// as tofu on the web. (#138) +fn tip_node<'a>(content: Element<'a, Message>, body: Element<'a, Message>) -> Element<'a, Message> { tooltip( content, - container(text(label).size(11).color(Color::WHITE)) + container(body) .style(|_: &Theme| container::Style { background: Some(Background::Color(Color { r: 0.13, @@ -519,7 +526,20 @@ fn osnap_btn(active: bool, snap_enabled: bool, open: bool) -> Element<'static, M row![ tip(left.into(), "Object Snap: toggle on/off\nF3"), - tip(right.into(), "Object Snap settings\nClick ▾"), + tip_node( + right.into(), + column![ + text("Object Snap settings").size(11).color(Color::WHITE), + row![ + text("Click").size(11).color(Color::WHITE), + crate::ui::icons::arrow_down(9.0, Color::WHITE), + text("to open the list").size(11).color(Color::WHITE), + ] + .spacing(3) + .align_y(iced::Center), + ] + .into(), + ), ] .spacing(0) .into()