10 Label::Label(const string &t)
16 void Label::autosize()
23 if(const Part *text_part = style->get_part("text"))
25 const Sides &margin = text_part->get_margin();
26 geom.w = max(geom.w, text.get_width()+margin.left+margin.right);
27 geom.h = max(geom.h, text.get_height()+margin.top+margin.bottom);
31 void Label::set_text(const string &t)
34 signal_autosize_changed.emit();
37 void Label::render_special(const Part &part) const
39 if(part.get_name()=="text")
40 text.render(part, geom);
43 void Label::on_style_change()
45 text.set_style(style);
49 Label::Loader::Loader(Label &l):
52 add("text", &Loader::text);
55 void Label::Loader::text(const string &t)
57 static_cast<Label &>(obj).text = t;