rich_label: move attributes to ctor

This commit is contained in:
Subhraman Sarkar 2024-09-19 10:41:49 +05:30 committed by Celtic Minstrel
parent dc68d261ca
commit 069a0c659d

View file

@ -55,12 +55,12 @@ rich_label::rich_label(const implementation::builder_rich_label& builder)
: styled_widget(builder, type())
, state_(ENABLED)
, can_wrap_(true)
, link_aware_(true)
, link_aware_(builder.link_aware)
, link_color_(font::YELLOW_COLOR)
, can_shrink_(true)
, text_alpha_(ALPHA_OPAQUE)
, unparsed_text_()
, w_(0)
, w_(builder.width(get_screen_size_variables()))
, h_(0)
, padding_(4)
{
@ -869,13 +869,8 @@ std::unique_ptr<widget> builder_rich_label::build() const
const auto conf = lbl->cast_config_to<rich_label_definition>();
assert(conf);
const wfl::map_formula_callable& size = get_screen_size_variables();
const unsigned w = width(size);
lbl->set_text_alignment(text_alignment);
lbl->set_link_aware(link_aware);
lbl->set_link_color(conf->link_color);
lbl->set_width(w);
lbl->set_label(lbl->get_label());
DBG_GUI_G << "Window builder: placed rich_label '" << id << "' with definition '"