}
+void List::SimpleItem::on_style_change()
+{
+ if(!style || children.empty())
+ return;
+
+ Widget *child = children.front()->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<unsigned> &widths) const
{
if(widths.size()<children.size())
add(label);
}
-void List::BasicItem::on_style_change()
-{
- if(!style)
- return;
-
- label.autosize();
- if(const Part *part = style->get_part("children"))
- {
- const Sides &margin = part->get_margin();
- label.set_position(margin.left, margin.bottom);
- }
-}
-
List::Loader::Loader(List &l):
DataFile::DerivedObjectLoader<List, Widget::Loader>(l)
virtual void render_special(const Part &, GL::Renderer &) const;
};
+ class SimpleItem: public Item
+ {
+ private:
+ virtual void on_style_change();
+ };
+
class MultiColumnItem: public Item
{
protected:
};
private:
- class BasicItem: public Item
+ class BasicItem: public SimpleItem
{
private:
Label label;
public:
BasicItem(const std::string &);
-
- private:
- virtual void on_style_change();
};
class ItemFactory