- const Sides &margin = part.get_margin();
- Geometry pgeom = geom;
- pgeom.h = row_height+margin.top+margin.bottom;
-
- const GL::Font &font = style->get_font();
- cache.texture = &font.get_texture();
- cache.clear_mesh();
-
- GL::MeshBuilder bld(*cache.mesh);
- bld.color(style->get_font_color());
- bld.matrix() *= GL::Matrix::translation(margin.left, geom.h-pgeom.h-font.get_descent()*style->get_font_size(), 0);
-
- for(unsigned i=0; (i<n_visible && first+i<data->size()); ++i)
- {
- if(i!=0)
- bld.matrix() *= GL::Matrix::translation(0, -static_cast<int>(row_height), 0);
-
- GL::MatrixStack::Push _pushm(bld.matrix());
- bld.matrix() *= GL::Matrix::scaling(style->get_font_size());
-
- style->get_font().build_string(data->get_string(first+i), bld);
- }
- }
- else if(part.get_name()=="selection")
- {
- if(sel_index>=static_cast<int>(first) && sel_index<static_cast<int>(first+n_visible))
- {
- const Sides &margin = part.get_margin();
-
- Geometry pgeom = geom;
- pgeom.h = row_height;
- pgeom.w -= margin.left+margin.right;
-
- Geometry rgeom = part.get_geometry();
- rgeom.y += geom.h-margin.top-row_height*(sel_index-first+1);
- rgeom.x += margin.left;
- part.get_alignment().apply(rgeom, pgeom);
-
- cache.texture = part.get_graphic(state)->get_texture();
- cache.clear_mesh();
-
- GL::MeshBuilder bld(*cache.mesh);
- bld.matrix() *= GL::Matrix::translation(rgeom.x, rgeom.y, 0);
- part.get_graphic(state)->build(rgeom.w, rgeom.h, bld);
- }
- else
- cache.texture = 0;