diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-10-23 01:36:55 +0200 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-10-23 01:36:55 +0200 |
| commit | 17baeceb7ab90251f99c7909eb9eeca92aec5a05 (patch) | |
| tree | 76fc446e2060f38dfda5e769640c2277d2010eb6 /fluid/factory.cxx | |
| parent | ab6ef9d52f60ac991baafc7af33775e34484f358 (diff) | |
FLUID: Positioning grid cells intuitively.
User can now drag widgets from the toolbox into the grid
or use the context menu to add them into the corresponding
cell. If no position is indicated, now children are added at the
first free cell.
Diffstat (limited to 'fluid/factory.cxx')
| -rw-r--r-- | fluid/factory.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fluid/factory.cxx b/fluid/factory.cxx index 28e71068e..7bd93f946 100644 --- a/fluid/factory.cxx +++ b/fluid/factory.cxx @@ -26,6 +26,7 @@ #include "fluid.h" #include "Fl_Group_Type.h" +#include "Fl_Grid_Type.h" #include "Fl_Menu_Type.h" #include "Fd_Snap_Action.h" #include "pixmaps.h" @@ -1225,6 +1226,13 @@ Fl_Type *add_new_widget_from_user(Fl_Type *inPrototype, Strategy strategy) { wt->o->size(w, h); } } + if (t->parent && t->parent->is_a(ID_Grid)) { + if (Fl_Window_Type::popupx != 0x7FFFFFFF) { + ((Fl_Grid_Type*)t->parent)->insert_child_at(((Fl_Widget_Type*)t)->o, Fl_Window_Type::popupx, Fl_Window_Type::popupy); + } else { + ((Fl_Grid_Type*)t->parent)->insert_child(((Fl_Widget_Type*)t)->o); + } + } } if (t->is_a(ID_Window)) { int x = 0, y = 0, w = 480, h = 320; |
