* BUG: Reparenting a container correctly keeps the visibility state of its 
  children.


git-svn-id: svn://localhost/gambas/trunk@5262 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2012-10-29 01:44:27 +00:00
parent fb2c780011
commit 1f734dfd83

View file

@ -1060,13 +1060,28 @@ bool gMainWindow::close()
return doClose();
}
static void hide_hidden_children(gContainer *cont)
{
int i;
gControl *child;
for (i = 0;; i++)
{
child = cont->child(i);
if (!child)
break;
if (!child->isVisible())
gtk_widget_hide(child->border);
else if (child->isContainer())
hide_hidden_children((gContainer *)child);
}
}
void gMainWindow::reparent(gContainer *newpr, int x, int y)
{
GtkWidget *new_border;
int w, h;
gColor fg, bg;
int i;
gControl *child;
if (_xembed)
return;
@ -1104,14 +1119,7 @@ void gMainWindow::reparent(gContainer *newpr, int x, int y)
gtk_widget_set_size_request(border, width(), height());
// Hidden children are incorrectly shown. Fix that!
for (i = 0;; i++)
{
child = getControl(i);
if (!child)
break;
if (!child->isVisible())
child->setVisible(false);
}
hide_hidden_children(this);
}
else if ((!isTopLevel() && !newpr)
|| (isTopLevel() && isPopup()))