delete data;
}
-void List::autosize()
+void List::autosize_special(const Part &part, Geometry &ageom)
{
- if(!style)
- return;
-
- Widget::autosize();
-
- if(const Part *items_part = style->get_part("items"))
+ if(part.get_name()=="items")
{
- const Sides &margin = items_part->get_margin();
+ const Sides &margin = part.get_margin();
unsigned max_w = 0;
unsigned total_h = 0;
if(!items.empty() && items.size()<view_size)
total_h = total_h*view_size/items.size();
- geom.w = max(geom.w, max_w+margin.left+margin.right);
- geom.h = max(geom.h, total_h+margin.top+margin.bottom);
+ ageom.w = max(ageom.w, max_w+margin.left+margin.right);
+ ageom.h = max(ageom.h, total_h+margin.top+margin.bottom);
}
-
- check_view_range();
- rebuild();
}
void List::set_data(ListData &d)
}
-void List::Item::autosize()
+void List::Item::autosize_special(const Part &part, Geometry &ageom)
{
- Widget::autosize();
-
- if(const Part *part = style->get_part("children"))
+ if(part.get_name()=="children")
{
- const Sides &margin = part->get_margin();
+ const Sides &margin = part.get_margin();
for(list<Child *>::const_iterator i=children.begin(); i!=children.end(); ++i)
{
const Geometry &cgeom = (*i)->widget->get_geometry();
- geom.w = max(geom.w, cgeom.x+cgeom.w+margin.right);
- geom.h = max(geom.h, cgeom.y+cgeom.h+margin.top);
+ ageom.w = max(ageom.w, cgeom.x+cgeom.w+margin.right);
+ ageom.h = max(ageom.h, cgeom.y+cgeom.h+margin.top);
}
}
}