- GL::push_matrix();
- GL::translate(rgeom.x, rgeom.y, 0);
- part.get_graphic(state)->render(rgeom.w, rgeom.h);
- GL::pop_matrix();
+ 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;
+ }
+}
+
+void List::render_special(const Part &part, GL::Renderer &renderer) const
+{
+ if(part.get_name()=="slider")
+ slider.render(renderer);
+}
+
+void List::button_press(int x, int y, unsigned btn)
+{
+ Container::button_press(x, y, btn);
+ if(!click_focus && btn==1)
+ {
+ if(items_part)
+ y += items_part->get_margin().top;
+
+ unsigned i = (geom.h-1-y)/row_height;
+ if(i<n_visible && first+i<items.size())
+ {
+ sel_index = first+i;
+
+ signal_item_selected.emit(sel_index, items[sel_index]);
+ rebuild();