mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-17 21:52:32 +00:00
Notice: the elements sit inside the notice's padding, so a card's text and buttons are inset from its edge
This commit is contained in:
@@ -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::<NoticeWords>(), 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 {
|
||||
|
||||
Reference in New Issue
Block a user