summaryrefslogtreecommitdiff
path: root/fluid/Fl_Group_Type.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2022-11-26 01:35:50 +0100
committerGitHub <noreply@github.com>2022-11-26 01:35:50 +0100
commit6e5c472cf9641426c5425ea2f404e8908d76d63e (patch)
tree0f7ec46f88f01257702f1f9a7c8323a7fdc768c3 /fluid/Fl_Group_Type.cxx
parentc1a7c4af042a593b4b3a1df3e750b0cc80362486 (diff)
Handle Fluid project settings better (#556)
Fix allocation bug in Fl_String
Diffstat (limited to 'fluid/Fl_Group_Type.cxx')
-rw-r--r--fluid/Fl_Group_Type.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/fluid/Fl_Group_Type.cxx b/fluid/Fl_Group_Type.cxx
index 37e0e8923..542f29ef8 100644
--- a/fluid/Fl_Group_Type.cxx
+++ b/fluid/Fl_Group_Type.cxx
@@ -24,6 +24,7 @@
#include "file.h"
#include "code.h"
#include "widget_browser.h"
+#include "undo.h"
#include <FL/Fl.H>
#include <FL/Fl_Group.H>
@@ -79,6 +80,8 @@ void group_cb(Fl_Widget *, void *) {
fl_message("Please select widgets to group");
return;
}
+ undo_checkpoint();
+ undo_suspend();
Fl_Widget_Type* q = (Fl_Widget_Type*)qq;
force_parent = 1;
Fl_Group_Type *n = (Fl_Group_Type*)(Fl_Group_type.make(kAddAsLastChild));
@@ -93,6 +96,8 @@ void group_cb(Fl_Widget *, void *) {
}
fix_group_size(n);
widget_browser->rebuild();
+ undo_resume();
+ set_modflag(1);
}
void ungroup_cb(Fl_Widget *, void *) {
@@ -111,6 +116,8 @@ void ungroup_cb(Fl_Widget *, void *) {
return;
}
}
+ undo_checkpoint();
+ undo_suspend();
for (n = q->next; n && n->level > q->level;) {
Fl_Type *nxt = n->remove();
n->insert(q);
@@ -118,6 +125,8 @@ void ungroup_cb(Fl_Widget *, void *) {
}
delete q;
widget_browser->rebuild();
+ undo_resume();
+ set_modflag(1);
}
////////////////////////////////////////////////////////////////