use druid::{
widget::{Label, LabelText},
Data, Env,
};
use crate::theme::color as theme;
#[inline]
pub fn new<T: Data>(text: impl Into<LabelText<T>>) -> Label<T> {
Label::new(text)
.with_font(theme::typography::BASE)
.with_text_size(13.)
.with_text_color(theme::typography::FONT_COLOR)
.with_text_alignment(druid::TextAlignment::Start)
.with_line_break_mode(druid::widget::LineBreaking::WordWrap)
}
#[inline]
pub fn dynamic<T: Data>(text: impl Fn(&T, &Env) -> String + 'static) -> Label<T> {
let text: LabelText<T> = text.into();
new(text)
}