use super::{InlineImpl, Span, TextElementImpl};
use super::TextElement;
use ferroui_base::media::FontWeight;
use ferroui_base::{
ferro_class, ferro_impl_classes, instantiate, FerroObjectImpl, FerroObjectImplExt, Ref, StyledElementImpl,
};
#[repr(C)]
pub struct Bold {
base: Span,
}
ferro_class!(Bold: Span);
ferroui_base::ferro_class_info!(Bold { new: Bold::new });
ferro_impl_classes!(Bold: StyledElementImpl, TextElementImpl, InlineImpl);
impl FerroObjectImpl for Bold {
fn constructed(this: &Self) {
Self::parent_constructed(this);
this.set_current_value(TextElement::font_weight_property(), FontWeight::Bold);
}
}
impl Bold {
fn static_constructor() {
TextElement::font_weight_property().override_default_value::<Bold>(FontWeight::Bold);
}
pub fn construct() -> Self {
Self { base: Span::construct() }
}
pub fn new() -> Ref<Self> {
instantiate(Self::construct())
}
}