From 04ffcdba240ced893791ccbced3553ed336dc945 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 28 Nov 2026 17:47:50 +0000 Subject: [PATCH] backstage: the glyph Back is a side-menu row face with its label unpainted The glyph lines up with the entries' glyphs at the side menu's icon size instead of a small icon button. Co-Authored-By: Claude Opus 5.5 --- crates/menu/src/ribbon/backstage.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/crates/menu/src/ribbon/backstage.rs b/crates/menu/src/ribbon/backstage.rs index 548b80472d..f484de6466 100644 --- a/crates/menu/src/ribbon/backstage.rs +++ b/crates/menu/src/ribbon/backstage.rs @@ -7,7 +7,7 @@ use std::fmt::Debug; use std::hash::Hash; use craft_behavior::{Metrics, NavShape, Roving}; -use craft_ui::buttons::{Button, ControlPlace, IconButton}; +use craft_ui::buttons::{Button, ControlPlace}; use craft_ui::contract::{ BodyCx, BodyLayout, Common, Component, Container, ContainerProps, Cx, Gap, LeastWidth, NoValue, Outcome, Pad, Props as _, Role, Scroll, Show as _, ShowContainer as _, Sizing, @@ -139,18 +139,13 @@ impl<'a, K: Clone + Eq + Hash + Send + Sync + Debug + 'static> BackstageView<'a, .show_at(ui, rail, |ui, _| { if self.back { let glyph = craft_behavior::IconId::new("chevron_left"); + // The glyph alone is still a side-menu row's face, so its glyph lines up with the entries'. + let back = Button::new(words.back.clone()).icon(glyph).variant(Variant::GHOST).align(HAlign::Start); let back = match self.back_look { - BackLook::Labelled => { - Button::new(words.back.clone()) - .icon(glyph) - .variant(Variant::GHOST) - .sizing(Sizing::FillWidth) - .align(HAlign::Start) - .show(ui) - .response - } - BackLook::Glyph => IconButton::new(glyph).label(words.back.clone()).tooltip(words.back.clone()).show(ui).response, + BackLook::Labelled => back.sizing(Sizing::FillWidth), + BackLook::Glyph => back.painted(Label::Empty).tooltip(words.back.clone()), }; + let back = back.show(ui).response; if craft_ui::contract::clicked(&back) { event = Some(BackstageEvent::Back); }