+void Entry::autosize_special(const Part &part, Geometry &ageom) const
+{
+ if(part.get_name()=="text")
+ {
+ const Sides &margin = part.get_margin();
+ const GL::Font &font = style->get_font();
+ unsigned en_width = static_cast<unsigned>(font.get_string_width("n")*style->get_font_size());
+ ageom.w = max(ageom.w, edit_width*en_width+margin.left+margin.right);
+
+ unsigned line_height = static_cast<unsigned>((font.get_ascent()-font.get_descent())*style->get_font_size());
+ if(multiline)
+ {
+ unsigned line_spacing = style->get_font_size()*6/5;
+ ageom.h = max(ageom.h, line_height+line_spacing*(edit_height-1)+margin.top+margin.bottom);
+ }
+ else
+ ageom.h = max(ageom.h, line_height+margin.top+margin.bottom);
+ }
+ else if(part.get_name()=="slider" && multiline)
+ {
+ Geometry sgeom = part.get_geometry();
+ if(!sgeom.w || !sgeom.h)
+ {
+ Geometry wgeom;
+ slider->autosize(wgeom);
+ if(!sgeom.w)
+ sgeom.w = wgeom.w;
+ if(!sgeom.h)
+ sgeom.h = wgeom.h;
+ }
+
+ const Sides &margin = part.get_margin();
+ ageom.w = max(ageom.w, sgeom.w+margin.left+margin.right);
+ ageom.h = max(ageom.h, sgeom.h+margin.top+margin.bottom);
+ }
+}
+