+ if(!style)
+ return;
+
+ Widget::autosize();
+
+ if(const Part *slider_part = style->get_part("slider"))
+ {
+ const Sides &margin = slider_part->get_margin();
+ const Geometry &pgeom = slider_part->get_geometry();
+ geom.w = std::max(geom.w, pgeom.w+margin.left+margin.right);
+ geom.h = std::max(geom.h, pgeom.h*3/2+margin.top+margin.bottom);
+ }
+}
+
+void VSlider::rebuild_special(const Part &part)
+{
+ if(part.get_name()=="slider")
+ {
+ const Graphic *graphic = part.get_graphic(state);
+ if(!graphic || !graphic->get_texture())
+ return;
+
+ Alignment align = part.get_alignment();
+ if(max>min)
+ align.y = (value-min)/(max-min);
+
+ Geometry pgeom = part.get_geometry();
+ align.apply(pgeom, geom, part.get_margin());
+
+ GL::MeshBuilder bld(part_cache.create_mesh(part, *graphic->get_texture()));
+ bld.matrix() *= GL::Matrix::translation(pgeom.x, pgeom.y, 0);
+ graphic->build(pgeom.w, pgeom.h, bld);
+ }