X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flist.cpp;h=9be88e52c9ce65acecdf98b550d78a5db9a672ee;hb=6e58cefe8fd7aa736e528803ba483b9c8514bda1;hp=a9cbcc1c5f02af4080ca895f18525dfcea61af1e;hpb=35f6cfcfb7a7278251d890988fdf6a6bbf793ef8;p=libs%2Fgltk.git diff --git a/source/list.cpp b/source/list.cpp index a9cbcc1..9be88e5 100644 --- a/source/list.cpp +++ b/source/list.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "graphic.h" #include "list.h" #include "part.h" @@ -70,18 +71,16 @@ void List::autosize_special(const Part &part, Geometry &ageom) const const Sides &margin = part.get_margin(); unsigned max_w = 0; - unsigned total_h = 0; + unsigned max_h = 0; for(unsigned i=0; iautosize(igeom); max_w = max(max_w, igeom.w); - if(view_size==0 || i0) set_focus_index(focus_index-1); } - else if(nav==NAV_DOWN && !items.empty()) + else if(nav==NAV_DOWN) { if(static_cast(focus_index+1)widget; + child->autosize(); + if(const Part *part = style->get_part("children")) + { + const Sides &margin = part->get_margin(); + child->set_position(margin.left, margin.bottom); + } +} + + void List::MultiColumnItem::check_widths(vector &widths) const { if(widths.size()get_part("children")) - { - const Sides &margin = part->get_margin(); - label.set_position(margin.left, margin.bottom); - } -} - List::Loader::Loader(List &l): DataFile::DerivedObjectLoader(l)