void Column::finish_widget(Widget &wdg)
{
+ LinearArrangement::finish_widget(wdg);
layout.set_gravity(wdg, -1, (gravity==BOTTOM ? -1 : 1));
}
split_here(false),
gravity(opposite),
internal_aligned(false),
+ uniform(false),
+ uniform_ref(0),
next_spacing(-1)
{ }
+void LinearArrangement::set_uniform(bool u)
+{
+ uniform = u;
+ if(!uniform)
+ uniform_ref = 0;
+}
+
void LinearArrangement::split()
{
if(gravity==primary)
}
}
+void LinearArrangement::finish_widget(Widget &wdg)
+{
+ if(uniform)
+ {
+ if(!uniform_ref)
+ uniform_ref = &wdg;
+ else
+ {
+ Layout::ConstraintType ct = ((primary==LEFT || primary==RIGHT) ? Layout::COPY_WIDTH : Layout::COPY_HEIGHT);
+ layout.add_constraint(wdg, ct, *uniform_ref);
+ }
+ }
+}
+
void LinearArrangement::finish_slot()
{
internal_aligned = next.aligned;
add("expand", &Loader::expand);
add("spacing", &Loader::spacing);
add("split", &Loader::split);
+ add("uniform", &Loader::uniform);
}
void LinearArrangement::Loader::expand()
obj.split();
}
+void LinearArrangement::Loader::uniform(bool u)
+{
+ obj.set_uniform(u);
+}
+
} // namespace GLtk
} // namespace Msp
void expand();
void spacing(unsigned);
void split();
+ void uniform(bool);
};
protected:
bool split_here;
Side gravity;
bool internal_aligned;
+ bool uniform;
+ Widget *uniform_ref;
int next_spacing;
LinearArrangement(Layout &, Side);
public:
+ void set_uniform(bool);
void split();
void expand();
void spacing(unsigned);
protected:
virtual void process_widget(Widget &, Side, bool);
+ virtual void finish_widget(Widget &);
virtual void finish_slot();
};
void Row::finish_widget(Widget &wdg)
{
+ LinearArrangement::finish_widget(wdg);
layout.set_gravity(wdg, (gravity==LEFT ? -1 : 1), 1);
}