summaryrefslogtreecommitdiff
path: root/fluid/Fl_Grid_Type.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2024-10-22 13:49:48 +0200
committerMatthias Melcher <github@matthiasm.com>2024-10-22 13:49:48 +0200
commit2228ec22d71117fbf346da1f1c0ae341328dbc02 (patch)
treeffc0c24052f73319e38456bd1e925095daec0c4b /fluid/Fl_Grid_Type.cxx
parentfb5c6522005d08c547bf93cddfc9cd156a59fd81 (diff)
FLUID: Adds missing code for Grid and Flex live: #1092
Diffstat (limited to 'fluid/Fl_Grid_Type.cxx')
-rw-r--r--fluid/Fl_Grid_Type.cxx28
1 files changed, 27 insertions, 1 deletions
diff --git a/fluid/Fl_Grid_Type.cxx b/fluid/Fl_Grid_Type.cxx
index af1c6267e..45110a880 100644
--- a/fluid/Fl_Grid_Type.cxx
+++ b/fluid/Fl_Grid_Type.cxx
@@ -303,13 +303,39 @@ void Fl_Grid_Type::copy_properties()
{
super::copy_properties();
Fl_Grid *d = (Fl_Grid*)live_widget, *s =(Fl_Grid*)o;
+ d->layout(s->rows(), s->cols());
int lm, tm, rm, bm;
s->margin(&lm, &tm, &rm, &bm);
d->margin(lm, tm, rm, bm);
int rg, cg;
s->gap(&rg, &cg);
d->gap(rg, cg);
- // TODO: lots to do!
+ // copy col widths, heights, and gaps
+ for (int c=0; c<s->cols(); c++) {
+ d->col_width(c, s->col_width(c));
+ d->col_gap(c, s->col_gap(c));
+ d->col_weight(c, s->col_weight(c));
+ }
+ // copy row widths, heights, and gaps
+ for (int r=0; r<s->rows(); r++) {
+ d->row_height(r, s->row_height(r));
+ d->row_gap(r, s->row_gap(r));
+ d->row_weight(r, s->row_weight(r));
+ }
+}
+
+void Fl_Grid_Type::copy_properties_for_children() {
+ Fl_Grid *d = (Fl_Grid*)live_widget, *s =(Fl_Grid*)o;
+ for (int i=0; i<s->children(); i++) {
+ Fl_Grid::Cell *cell = s->cell(s->child(i));
+ if (cell && i<d->children()) {
+ d->widget(d->child(i),
+ cell->row(), cell->col(),
+ cell->rowspan(), cell->colspan(),
+ cell->align());
+ }
+ }
+ d->layout();
}
void Fl_Grid_Type::write_properties(Fd_Project_Writer &f)