diff --git a/crates/ui-canvas/src/canvas/full_window_parts/side.rs b/crates/ui-canvas/src/canvas/full_window_parts/side.rs index a2a575df7..16e99a842 100644 --- a/crates/ui-canvas/src/canvas/full_window_parts/side.rs +++ b/crates/ui-canvas/src/canvas/full_window_parts/side.rs @@ -3,7 +3,7 @@ use crate::contract::{ BodyCx, Common, Component, Container, ContainerProps, Cx, FooterPlace, HeaderRegion, NoValue, Outcome, Pad, Props as _, Role, RowAlign, Scroll, - Show as _, ShowContainer as _, Sizing, WordSetCx as _, + Show as _, ShowContainer as _, Sizing, WordSetCx as _, WrapWidth, }; use crate::layout_components::Row; use crate::runtime::focus::FocusPolicy; @@ -99,7 +99,8 @@ impl Outcome for FullWindowSideOutput { /// [`headerless`](Self::headerless); the body padded by the panel tier. /// - **Body.** Scrolls vertically when taller than the room; [`unscrolled`](Self::unscrolled) leaves the scroll out /// for a pane that bounds itself. -/// - **Size.** As wide as its content; as high as its content, at most the room of the side columns. +/// - **Size.** As wide as its content; as high as its content, at most the room of the side columns. Its paragraphs +/// (a message, a failure) wrap at a dialog's line length, so a long one does not widen the column past it. /// - **Footer.** None of its own: the dialog's buttons sit in the dialog's footer, which [`SideFooter`] places among /// the side columns. /// - **Keyboard and AccessKit.** A group named by the label, an F6 pane; Tab goes top to bottom. @@ -121,6 +122,7 @@ impl FullWindowSide { .surface(SurfaceKind::Panel) .pad(Pad::Regular) .sizing(Sizing::Content) + .wrap_width(WrapWidth::Dialog) .header(HeaderRegion::new().rule(true)) .scroll(Scroll::vertical()) .focus(FocusPolicy::PANE); diff --git a/crates/ui-widgets/src/notices/notice.rs b/crates/ui-widgets/src/notices/notice.rs index 6c4ae9ae6..77ff16043 100644 --- a/crates/ui-widgets/src/notices/notice.rs +++ b/crates/ui-widgets/src/notices/notice.rs @@ -558,14 +558,16 @@ impl Component for Notice<'_> { room.map_or(width, |room| width.min(room)) } (NoticeLayout::Centred, None) => natural.min(cx.style.reading_width), - // A row notice takes the room it is given; an unbounded room (a column sized by its content) leaves it at - // its natural width. - (_, Some(room)) if room.is_finite() => room, - (_, _) => natural, + (_, Some(room)) => room, + // A row notice offered no room (a unit of a row, a column sized by its content) takes its line, at most + // the column's room: in a container that sets a line length, its paragraphs' wrap width. + (_, None) => cx.column_room().map_or(natural, |column| natural.min(column)), }; - if !width.is_finite() || cx.room.is_some_and(|room| !room.is_finite()) { + { let test = std::thread::current().name().unwrap_or("?").rsplit("::").next().unwrap_or("?").to_owned(); - eprintln!("DIAG {test}: notice measure room {:?} natural {natural} width {width}", cx.room); + if test.starts_with("an_erased_sampling") || test.starts_with("brush_strokes_change") { + eprintln!("DIAG {test}: notice measure room {:?} column {:?} natural {natural} width {width}", cx.room, cx.column_room()); + } } Vec2::new(width, self.plan(cx, &texts, self.wrap_width(cx, width)).height) }