Enable text wrapping for Details

This commit is contained in:
Marshall Bowers 2023-10-20 16:13:54 -04:00
parent a6d8915b6c
commit 4dc2440024

View file

@ -38,6 +38,7 @@ impl<S: 'static + Send + Sync> Details<S> {
.gap_0p5() .gap_0p5()
.text_xs() .text_xs()
.text_color(color.text) .text_color(color.text)
.size_full()
.child(self.text) .child(self.text)
.children(self.meta.map(|m| m)) .children(self.meta.map(|m| m))
.children(self.actions.take().map(|a| a)) .children(self.actions.take().map(|a| a))
@ -49,7 +50,7 @@ pub use stories::*;
#[cfg(feature = "stories")] #[cfg(feature = "stories")]
mod stories { mod stories {
use crate::Story; use crate::{Button, Story};
use super::*; use super::*;
@ -79,6 +80,15 @@ mod stories {
Details::new("The quick brown fox jumps over the lazy dog") Details::new("The quick brown fox jumps over the lazy dog")
.meta_text("Sphinx of black quartz, judge my vow."), .meta_text("Sphinx of black quartz, judge my vow."),
) )
.child(Story::label(cx, "With meta and actions"))
.child(
Details::new("The quick brown fox jumps over the lazy dog")
.meta_text("Sphinx of black quartz, judge my vow.")
.actions(ButtonGroup::new(vec![
Button::new("Decline"),
Button::new("Accept").variant(crate::ButtonVariant::Filled),
])),
)
} }
} }
} }