Panel footer actions show their icons at the tool size (size.icon.md)

This commit is contained in:
aiongg
2026-11-12 15:23:58 +00:00
parent 6924d6a1bf
commit 237e2a1566
3 changed files with 9 additions and 6 deletions
+2 -1
View File
@@ -29,7 +29,8 @@ pub enum GlyphRole {
/// A glyph inside a control: `size.icon.glyph_sm` or `glyph_md` by the control size, in the variant's ink.
#[default]
Control,
/// A command strip of tool icons (align and distribute): `size.icon.md`, in the variant's ink.
/// A command strip of tool icons (align and distribute) or a panel footer's actions: `size.icon.md`, in the
/// variant's ink.
Tool,
/// A tool rail: `size.icon.lg`, resting in `text.muted` and in the variant's ink under the pointer.
ToolRail,
+6 -4
View File
@@ -12,7 +12,7 @@ use crate::runtime::access::Name;
use crate::runtime::env::{Env, EnvValue, Label};
use crate::runtime::focus;
use crate::runtime::keys;
use crate::style::{ComponentStyle, RuleKind, StyleCx};
use crate::style::{ComponentStyle, GlyphRole, RuleKind, StyleCx};
use craft_behavior::{Insets, Metrics, OwnerClass, Sense};
use craft_host::target::Os;
use craft_keymap::{Chord, Key};
@@ -566,10 +566,12 @@ impl FooterBar {
/// A footer bar of icon actions laid out from the reading end, as Photoshop's panel footers: the first action given
/// sits at the end edge (Delete), the next one before it, and a panel menu given last at the start of the group.
/// Tab visits them in display order; the indexes the output reports are those of the given order. Show it with
/// `show_footer`.
/// Tab visits them in display order; the indexes the output reports are those of the given order. The actions show
/// their icons at the tool size (`GlyphRole::Tool`). Show it with `show_footer`.
pub fn actions(actions: impl IntoIterator<Item = FooterAction>) -> Self {
FooterBar { content: Content::Actions(actions.into_iter().collect()), actions: true, ..FooterBar::body() }
let body = FooterBar::body();
let props = body.props.child_glyphs(GlyphRole::Tool);
FooterBar { content: Content::Actions(actions.into_iter().collect()), actions: true, props, ..body }
}
/// The first `count` actions sit at the start edge in the given order and the rest from the end edge as
+1 -1
View File
@@ -973,7 +973,7 @@ A theme with its own shape replaces the radii or adds an offset to control, surf
| Role | Components |
| --- | --- |
| `size.control.sm`, `size.control.md` | Controls, fields, buttons |
| `size.icon.sm`, `size.icon.md`, `size.icon.lg` | Icons; `md` is the glyph of a tool strip (`GlyphRole::Tool`), `lg` of a tool rail (`GlyphRole::ToolRail`). A stroke icon below `md` draws `stroke.thin`, from `md` up `stroke.medium` |
| `size.icon.sm`, `size.icon.md`, `size.icon.lg` | Icons; `md` is the glyph of a tool strip and of a panel footer's actions (`GlyphRole::Tool`), `lg` of a tool rail (`GlyphRole::ToolRail`). A stroke icon below `md` draws `stroke.thin`, from `md` up `stroke.medium` |
| `size.icon.glyph_sm`, `size.icon.glyph_md` | The glyph in an icon-only button (`GlyphRole::Control`, the default; a container sets another with `ContainerProps::child_glyphs`) |
| `size.bar.title`, `size.bar.tab`, `size.bar.status`, `size.bar.options`, `size.bar.options_narrow` | Title bar, document tab bar, status bar, options bar |
| `size.panel_header` | Panel headers |