void Widget::update_style()
{
- style=&res.get_style(get_class(), style_name);
+ string sname=get_class();
+ if(!style_name.empty())
+ {
+ sname+='-';
+ sname+=style_name;
+ }
+ style=&res.get<Style>(sname);
}
void Widget::render_part(const Part &part) const
GL::push_matrix();
- part.get_alignment().apply(geom, text_w, static_cast<unsigned>(font_size));
+ part.get_alignment().apply(geom, text_w, static_cast<unsigned>(font->get_ascent()*font_size));
GL::scale_uniform(font_size);
- const Color &color=style->get_font_color();
+ const GL::Color &color=style->get_font_color();
glColor3f(color.r, color.g, color.b);
font->draw_string(text);
glColor3f(1, 1, 1);