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/Fl_Window_Type.cxx | |
| parent | 4b02c3614971f9334514e3f37cc27686c6485e2b (diff) | |
FLUID: Improves interactive handling of Grid and Flex
Diffstat (limited to 'fluid/Fl_Window_Type.cxx')
| -rw-r--r-- | fluid/Fl_Window_Type.cxx | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx index 433fc5863..2cf39e9da 100644 --- a/fluid/Fl_Window_Type.cxx +++ b/fluid/Fl_Window_Type.cxx @@ -822,7 +822,13 @@ void Fl_Window_Type::moveallchildren() Fl_Widget_Type* myo = (Fl_Widget_Type*)i; int x,y,r,t,ow=myo->o->w(),oh=myo->o->h(); newposition(myo,x,y,r,t); - myo->o->resize(x,y,r-x,t-y); + if (myo->is_a(ID_Flex) || myo->is_a(ID_Grid)) { + allow_layout++; + myo->o->resize(x,y,r-x,t-y); + allow_layout--; + } else { + myo->o->resize(x,y,r-x,t-y); + } if (Fl_Flex_Type::parent_is_flex(myo)) { Fl_Flex_Type* ft = (Fl_Flex_Type*)myo->parent; Fl_Flex* f = (Fl_Flex*)ft->o; @@ -837,15 +843,21 @@ void Fl_Window_Type::moveallchildren() f->layout(); } } - } - if (myo->parent && myo->parent->is_a(ID_Grid)) { + } else if (myo->parent && myo->parent->is_a(ID_Grid)) { Fl_Grid_Type* gt = (Fl_Grid_Type*)myo->parent; - gt->child_resized(myo); + if (drag & FD_DRAG) { + gt->insert_child_at(myo->o, Fl::event_x(), Fl::event_y()); + } else { + gt->child_resized(myo); + } + } else if (myo->parent && myo->parent->is_a(ID_Group)) { + Fl_Group_Type* gt = (Fl_Group_Type*)myo->parent; + ((Fl_Group*)gt->o)->init_sizes(); } // move all the children, whether selected or not: Fl_Type* p; for (p = myo->next; p && p->level>myo->level; p = p->next) - if (p->is_true_widget() && !myo->is_a(ID_Flex)) { + if (p->is_true_widget() && !myo->is_a(ID_Flex) && !myo->is_a(ID_Grid)) { Fl_Widget_Type* myo2 = (Fl_Widget_Type*)p; int X,Y,R,T; newposition(myo2,X,Y,R,T); |
