From e69897715f8a2e2283e1af346d989b0ab7ede465 Mon Sep 17 00:00:00 2001 From: aiongg Date: Thu, 12 Nov 2026 02:12:52 +0000 Subject: [PATCH] Notice: the elements sit inside the notice's padding, so a card's text and buttons are inset from its edge --- crates/ui-widgets/src/notices/notice.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-widgets/src/notices/notice.rs b/crates/ui-widgets/src/notices/notice.rs index 2b665d9e9..34c4c026d 100644 --- a/crates/ui-widgets/src/notices/notice.rs +++ b/crates/ui-widgets/src/notices/notice.rs @@ -514,12 +514,14 @@ impl Component for Notice<'_> { Sense::HOVER } - fn parts(&mut self, rect: Rect, cx: &mut PartsCx<'_, Self>) { + fn parts(&mut self, _rect: Rect, cx: &mut PartsCx<'_, Self>) { self.measure_content(cx); let rtl = cx.flow.is_rtl(); let gap = cx.gap(); let texts = self.texts(&cx.env, &cx.words::(), cx.format(), cx.resolved.label); let rect = if self.layout == NoticeLayout::Centred { + // The elements sit inside the padding: a card's content is inset from its surface's edge. + let rect = cx.content_rect; let column = Vec2::new(self.wrap_width(cx, rect.width()), rect.height()); Flow::new(rect, rtl).align(column, Align::Center, Align::Min) } else {