]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/list.cpp
Make font size a property of Style
[libs/gltk.git] / source / list.cpp
index a1803694a23633cd0a3911bafeb007e2eef1f141..e1f39b7dc8ecaa67db27c9212ada54ef24199593 100644 (file)
@@ -40,7 +40,7 @@ void List::autosize_rows(unsigned n)
        if(items_part)
        {
                const Sides &margin = items_part->get_margin();
-               float font_size = style->get_font()->get_default_size();
+               float font_size = style->get_font_size();
 
                unsigned max_w = 0;
                for(vector<string>::iterator i=items.begin(); i!=items.end(); ++i)
@@ -223,7 +223,7 @@ void List::on_style_change()
        items_part = style->get_part("items");
 
        const GL::Font &font = *style->get_font();
-       row_height = static_cast<unsigned>((font.get_ascent()-font.get_descent())*font.get_default_size());
+       row_height = static_cast<unsigned>((font.get_ascent()-font.get_descent())*style->get_font_size());
 
        check_view_range();
 }