node-based graph editor
git clone https://git.lucas.co/cce-graph.git
fix: context menu labels in the menu font
The shared menu's label run was drawn with `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. The family
now comes from `context_menu::label_font()`, the same face the labels
were laid out in. (The menu body here is still the legacy flat
`extra_quads` box rather than the DE's lit plate; that is a separate
question.)
Co-Authored-By: Claude Opus 5 <[email protected]>
src/main.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/main.rs b/src/main.rs
index bba6b56..3ee4826 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1384,6 +1384,10 @@ impl Application for GraphApp {
for (qx, qy, qw, qh, qc) in cce_ui::widget::context_menu::extra_quads() {
pc.quad(Rect { x: qx, y: qy, width: qw, height: qh }, qc);
}
+ // The menu font's family: a TextLabel carries only a size, so
+ // `None` here drew the menu in the default sans while the
+ // labels had been laid out in the configured face.
+ let (menu_family, _) = cce_ui::widget::context_menu::label_font();
for label in cce_ui::widget::context_menu::text_labels() {
pc.text_with(
label.text.clone(),
@@ -1391,7 +1395,7 @@ impl Application for GraphApp {
label.y,
label.font_size,
label.color,
- None,
+ Some(menu_family.clone()),
menu_bounds,
);
}