diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-10-31 22:00:29 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-10-31 22:00:38 +0100 |
| commit | 8bd1bd71622df37f097b04746a98389ddb890558 (patch) | |
| tree | e1ac3dde93bb660deab8013f7e50ec85c4bf8f22 /fluid/align_widget.cxx | |
| parent | 4b02c3614971f9334514e3f37cc27686c6485e2b (diff) | |
FLUID: Improves interactive handling of Grid and Flex
Diffstat (limited to 'fluid/align_widget.cxx')
| -rw-r--r-- | fluid/align_widget.cxx | 143 |
1 files changed, 39 insertions, 104 deletions
diff --git a/fluid/align_widget.cxx b/fluid/align_widget.cxx index 6bf7afee6..56cbd7c87 100644 --- a/fluid/align_widget.cxx +++ b/fluid/align_widget.cxx @@ -59,14 +59,9 @@ void align_widget_cb(Fl_Widget*, long how) undo_checkpoint(); } Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_a(ID_Menu_Manager_)) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(left, w->y(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(left, w->y(), w->w(), w->h()); - } + Fl_Type::allow_layout++; + w->resize(left, w->y(), w->w(), w->h()); + Fl_Type::allow_layout--; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -94,14 +89,9 @@ void align_widget_cb(Fl_Widget*, long how) undo_checkpoint(); } Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_a(ID_Menu_Manager_)) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize((center2-w->w())/2, w->y(), w->w(), w->h()); - } + Fl_Type::allow_layout++; + w->resize((center2-w->w())/2, w->y(), w->w(), w->h()); + Fl_Type::allow_layout--; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -126,14 +116,9 @@ void align_widget_cb(Fl_Widget*, long how) undo_checkpoint(); } Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_a(ID_Menu_Manager_)) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(right-w->w(), w->y(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(right-w->w(), w->y(), w->w(), w->h()); - } + Fl_Type::allow_layout++; + w->resize(right-w->w(), w->y(), w->w(), w->h()); + Fl_Type::allow_layout--; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -157,14 +142,9 @@ void align_widget_cb(Fl_Widget*, long how) undo_checkpoint(); } Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_a(ID_Menu_Manager_)) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(w->x(), top, w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(w->x(), top, w->w(), w->h()); - } + Fl_Type::allow_layout++; + w->resize(w->x(), top, w->w(), w->h()); + Fl_Type::allow_layout--; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -192,14 +172,9 @@ void align_widget_cb(Fl_Widget*, long how) undo_checkpoint(); } Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_a(ID_Menu_Manager_)) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(w->x(), (center2-w->h())/2, w->w(), w->h()); - } + Fl_Type::allow_layout++; + w->resize(w->x(), (center2-w->h())/2, w->w(), w->h()); + Fl_Type::allow_layout--; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -224,14 +199,9 @@ void align_widget_cb(Fl_Widget*, long how) undo_checkpoint(); } Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_a(ID_Menu_Manager_)) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize( w->x(), bot-w->h(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize( w->x(), bot-w->h(), w->w(), w->h()); - } + Fl_Type::allow_layout++; + w->resize( w->x(), bot-w->h(), w->w(), w->h()); + Fl_Type::allow_layout--; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -264,14 +234,9 @@ void align_widget_cb(Fl_Widget*, long how) undo_checkpoint(); } Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_a(ID_Menu_Manager_)) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h()); - } + Fl_Type::allow_layout++; + w->resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h()); + Fl_Type::allow_layout--; w->redraw(); if (w->window()) w->window()->redraw(); cnt++; @@ -306,14 +271,9 @@ void align_widget_cb(Fl_Widget*, long how) undo_checkpoint(); } Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_a(ID_Menu_Manager_)) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h()); - } + Fl_Type::allow_layout++; + w->resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h()); + Fl_Type::allow_layout--; w->redraw(); if (w->window()) w->window()->redraw(); cnt++; @@ -341,14 +301,9 @@ void align_widget_cb(Fl_Widget*, long how) undo_checkpoint(); } Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_a(ID_Menu_Manager_)) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(w->x(), w->y(), wdt, w->h()); - } else { - // Otherwise, just do the widget... - w->resize(w->x(), w->y(), wdt, w->h()); - } + Fl_Type::allow_layout++; + w->resize(w->x(), w->y(), wdt, w->h()); + Fl_Type::allow_layout--; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -372,14 +327,9 @@ void align_widget_cb(Fl_Widget*, long how) undo_checkpoint(); } Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_a(ID_Menu_Manager_)) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize( w->x(), w->y(), w->w(), hgt); - } else { - // Otherwise, just do the widget... - w->resize( w->x(), w->y(), w->w(), hgt); - } + Fl_Type::allow_layout++; + w->resize( w->x(), w->y(), w->w(), hgt); + Fl_Type::allow_layout--; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -405,14 +355,9 @@ void align_widget_cb(Fl_Widget*, long how) undo_checkpoint(); } Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_a(ID_Menu_Manager_)) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize( w->x(), w->y(), wdt, hgt); - } else { - // Otherwise, just do the widget... - w->resize( w->x(), w->y(), wdt, hgt); - } + Fl_Type::allow_layout++; + w->resize( w->x(), w->y(), wdt, hgt); + Fl_Type::allow_layout--; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -433,14 +378,9 @@ void align_widget_cb(Fl_Widget*, long how) if (w->window() == p) center2 = p->w(); else center2 = 2*p->x()+p->w(); - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_a(ID_Menu_Manager_)) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize((center2-w->w())/2, w->y(), w->w(), w->h()); - } + Fl_Type::allow_layout++; + w->resize((center2-w->w())/2, w->y(), w->w(), w->h()); + Fl_Type::allow_layout--; w->redraw(); if (w->window()) w->window()->redraw(); } @@ -460,14 +400,9 @@ void align_widget_cb(Fl_Widget*, long how) if (w->window() == p) center2 = p->h(); else center2 = 2*p->y()+p->h(); - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_a(ID_Menu_Manager_)) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(w->x(), (center2-w->h())/2, w->w(), w->h()); - } + Fl_Type::allow_layout++; + w->resize(w->x(), (center2-w->h())/2, w->w(), w->h()); + Fl_Type::allow_layout--; set_modflag(1); w->redraw(); if (w->window()) w->window()->redraw(); |
