From b8b46132b58fc2b8184d51eeaaebf22266257eae Mon Sep 17 00:00:00 2001 From: aiongg Date: Thu, 12 Nov 2026 00:48:43 +0000 Subject: [PATCH] A tool bar's members take the standard control size; options and status bars keep the small one The old toolbar's buttons were standard-size squares and its options and status bars small; Bar takes its child size from its kind. --- crates/ui-widgets/src/bars/bar.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/crates/ui-widgets/src/bars/bar.rs b/crates/ui-widgets/src/bars/bar.rs index a190b3dd3..fcadc7295 100644 --- a/crates/ui-widgets/src/bars/bar.rs +++ b/crates/ui-widgets/src/bars/bar.rs @@ -73,13 +73,14 @@ impl Outcome for BarOutput { } } -/// A bar over a chrome surface whose body holds the members in reading order at the small control size. They are one -/// roving group unless the bar is made of [`tab_stops`](Bar::tab_stops). The bar is as tall as its tallest member plus -/// the control padding, and takes the width it is offered. A bar of one row lays its body out as a row; a bar of -/// several rows as a stack whose rows the caller makes with `Row`. A row too long for the bar first narrows its selects -/// and elidable text, then scrolls, so a member past the edge is reached by Tab and revealed. A rule between groups of -/// members is a `Divider::vertical()`. A bar with `commit_cancel` ends with a cancel and a commit button in its end -/// region, outside the scroll; they run `BarCommands`. +/// A bar over a chrome surface whose body holds the members in reading order: a tool bar's at the standard control +/// size, an options or status bar's at the small one. They are one roving group unless the bar is made of +/// [`tab_stops`](Bar::tab_stops). The bar is as tall as its tallest member plus the control padding, and takes the +/// width it is offered. A bar of one row lays its body out as a row; a bar of several rows as a stack whose rows the +/// caller makes with `Row`. A row too long for the bar first narrows its selects and elidable text, then scrolls, so a +/// member past the edge is reached by Tab and revealed. A rule between groups of members is a `Divider::vertical()`. A +/// bar with `commit_cancel` ends with a cancel and a commit button in its end region, outside the scroll; they run +/// `BarCommands`. #[derive(crate::contract::Component)] #[component(container)] pub struct Bar<'a> { @@ -103,12 +104,13 @@ impl<'a> Bar<'a> { BarKind::Status => Gap::Section, }; let pad = if kind == BarKind::Options { Pad::Regular } else { Pad::Control }; + let size = if kind == BarKind::Tool { ControlSize::Md } else { ControlSize::Sm }; let mut props = ContainerProps::new() .surface(SurfaceKind::Chrome) .pad(pad) .sizing(Sizing::FillWidth) .body_gap(gap) - .child_size(ControlSize::Sm) + .child_size(size) .roving(Roving::new(NavShape::Flat)) .layout(BodyLayout::row()) .scroll(Scroll::horizontal());