git.lucas.co / cce-designer
graphic design tool
git clone https://git.lucas.co/cce-designer.git

commit0df114e05b66cca8a2c35f3d6c401f77d24709b2
parent46a1201c28
authorLucas Galante <[email protected]>
date2026-09-18 15:35
fix: context menu labels in the menu font

`paint()` plus a hand-rolled `text_labels()` loop passed `None` for the
family — a TextLabel carries only a size — so the menu rendered in the
default sans while the surface under it wore the configured face.
`paint_with_labels` (cce-ui) draws plate and labels in one call and
carries the family with them.

Co-Authored-By: Claude Opus 5 <[email protected]>

 src/render.rs | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/src/render.rs b/src/render.rs
index 0934793..657d80b 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -184,20 +184,10 @@ impl State {
         // extra_quads loop, which is the square opaque pre-frost look.
         // Its labels carry bounds equal to the menu rect so the engine's text-
         // occlusion clamp (which registers the menu rect) exempts them.
-        if cce_ui::widget::context_menu::is_visible() {
-            cce_ui::widget::context_menu::paint(&mut pc);
-            let mx = cce_ui::widget::context_menu::x();
-            let my = cce_ui::widget::context_menu::y();
-            let bounds = Some([
-                mx,
-                my,
-                mx + cce_ui::widget::context_menu::w(),
-                my + cce_ui::widget::context_menu::h(),
-            ]);
-            for l in cce_ui::widget::context_menu::text_labels() {
-                pc.text_with(l.text, l.x, l.y, l.font_size, l.color, None, bounds);
-            }
-        }
+        // One call for plate and labels: a TextLabel carries no family, so the
+        // hand-rolled `paint` + `text_labels()` pair here passed None and drew
+        // the menu in the default sans instead of the DE's menu font.
+        cce_ui::widget::context_menu::paint_with_labels(&mut pc);
 
         pc.finish()
     }