]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/list.cpp
Fix some problems with List and Dropdown
[libs/gltk.git] / source / list.cpp
index 7041f733759da99585d2b4dde562458a9684ea3e..218b26bd1410b82d7f33fb80c0dd6cbfa3bf86f1 100644 (file)
@@ -132,6 +132,7 @@ void List::set_selected_index(int i)
        {
                sel_index = i;
                signal_item_selected.emit(sel_index, items[sel_index]);
+               rebuild();
        }
        else
                throw out_of_range("List::set_selected_index");
@@ -159,7 +160,7 @@ void List::rebuild_special(const Part &part, CachedPart &cache)
 
                GL::MeshBuilder bld(*cache.mesh);
                bld.color(style->get_font_color());
-               bld.matrix() *= GL::Matrix::translation(pgeom.x, pgeom.y+geom.h-pgeom.h, 0);
+               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<items.size()); ++i)
                {