Commit 4371075e authored by Claes Sjofors's avatar Claes Sjofors

Ge disable for ungroup of group in group

parent 943f5c5f
...@@ -4004,6 +4004,16 @@ int GrowCtx::ungroup_select() ...@@ -4004,6 +4004,16 @@ int GrowCtx::ungroup_select()
int i; int i;
GrowGroup *group; GrowGroup *group;
// Groups in group can't be ungrouped
for ( i = 0; i < a_sel.size(); i++) {
if ( a_sel[i]->type() == glow_eObjectType_GrowGroup) {
group = (GrowGroup *)a_sel[i];
if ( group->parent)
return 0;
}
}
a_sel.set_highlight(0); a_sel.set_highlight(0);
for ( i = 0; i < a_sel.size(); i++) { for ( i = 0; i < a_sel.size(); i++) {
if ( a_sel[i]->type() == glow_eObjectType_GrowGroup) { if ( a_sel[i]->type() == glow_eObjectType_GrowGroup) {
...@@ -4022,6 +4032,9 @@ int GrowCtx::ungroup_select() ...@@ -4022,6 +4032,9 @@ int GrowCtx::ungroup_select()
void GrowCtx::ungroup_group( GrowGroup *group) void GrowCtx::ungroup_group( GrowGroup *group)
{ {
if ( group->parent)
return;
group->set_rootnode( 0); group->set_rootnode( 0);
group->ungroup(); group->ungroup();
a.remove( group); a.remove( group);
...@@ -4837,4 +4850,4 @@ int GrowCtx::find_by_name( const char *name, GlowArrayElem **element) ...@@ -4837,4 +4850,4 @@ int GrowCtx::find_by_name( const char *name, GlowArrayElem **element)
return ((GrowWindow *)wind)->window_ctx->find_by_name( &name[len+1], element); return ((GrowWindow *)wind)->window_ctx->find_by_name( &name[len+1], element);
} }
} }
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment