Set hidden flag variables BEFORE updating parent containers. Otherwise, parents won't reposition children correctly on systems where updates happen immediately (like OS X).

This commit is contained in:
Pietro Gagliardi 2015-04-29 14:25:34 -04:00
parent d7f903373f
commit 8f79f0596f
6 changed files with 13 additions and 12 deletions

View File

@ -114,9 +114,10 @@ static void containerShow(uiControl *cc)
[c setHidden:NO];
// hidden controls don't count in boxes and grids
// be sure to change the hidden variable FIRST, otherwise immediate resizes like on OS X don't work right
c.containerHidden = 0;
if (c.containerParent != NULL)
uiContainerUpdate(c.containerParent);
c.containerHidden = 0;
}
static void containerHide(uiControl *cc)
@ -124,9 +125,9 @@ static void containerHide(uiControl *cc)
containerView *c = (containerView *) (cc->Internal);
[c setHidden:YES];
c.containerHidden = 1;
if (c.containerParent != NULL)
uiContainerUpdate(c.containerParent);
c.containerHidden = 1;
}
static void containerEnable(uiControl *cc)

View File

@ -93,9 +93,9 @@ static void singleShow(uiControl *c)
singleView *s = (singleView *) (c->Internal);
[s->immediate setHidden:NO];
s->hidden = 0;
if (s->parent != NULL)
uiContainerUpdate(s->parent);
s->hidden = 0;
}
static void singleHide(uiControl *c)
@ -103,9 +103,9 @@ static void singleHide(uiControl *c)
singleView *s = (singleView *) (c->Internal);
[s->immediate setHidden:YES];
s->hidden = 1;
if (s->parent != NULL)
uiContainerUpdate(s->parent);
s->hidden = 1;
}
static void singleEnable(uiControl *c)

View File

@ -178,9 +178,9 @@ static void containerShow(uiControl *cc)
// don't use gtk_widget_show_all(); that'll show every widget, including ones hidden by the user
gtk_widget_show(GTK_WIDGET(c));
// hidden controls don't count in boxes and grids
c->hidden = 0;
if (c->parent != NULL)
uiContainerUpdate(c->parent);
c->hidden = 0;
}
static void containerHide(uiControl *cc)
@ -188,9 +188,9 @@ static void containerHide(uiControl *cc)
containerWidget *c = containerWidget(cc->Internal);
gtk_widget_hide(GTK_WIDGET(c));
c->hidden = 1;
if (c->parent != NULL)
uiContainerUpdate(c->parent);
c->hidden = 1;
}
static void containerEnable(uiControl *cc)

View File

@ -99,9 +99,9 @@ static void singleShow(uiControl *c)
singleWidget *s = (singleWidget *) (c->Internal);
gtk_widget_show_all(s->immediate);
s->hidden = 0;
if (s->parent != NULL)
uiContainerUpdate(s->parent);
s->hidden = 0;
}
static void singleHide(uiControl *c)
@ -109,9 +109,9 @@ static void singleHide(uiControl *c)
singleWidget *s = (singleWidget *) (c->Internal);
gtk_widget_hide(s->immediate);
s->hidden = 1;
if (s->parent != NULL)
uiContainerUpdate(s->parent);
s->hidden = 1;
}
static void singleEnable(uiControl *c)

View File

@ -179,9 +179,9 @@ static void containerShow(uiControl *cc)
ShowWindow(c->hwnd, SW_SHOW);
// hidden controls don't count in boxes and grids
c->hidden = 0;
if (c->parent != NULL)
uiContainerUpdate(c->parent);
c->hidden = 0;
}
static void containerHide(uiControl *cc)
@ -189,9 +189,9 @@ static void containerHide(uiControl *cc)
struct container *c = (struct container *) (cc->Internal);
ShowWindow(c->hwnd, SW_HIDE);
c->hidden = 1;
if (c->parent != NULL)
uiContainerUpdate(c->parent);
c->hidden = 1;
}
static void containerEnable(uiControl *cc)

View File

@ -73,9 +73,9 @@ static void singleShow(uiControl *c)
singleHWND *s = (singleHWND *) (c->Internal);
ShowWindow(s->hwnd, SW_SHOW);
s->hidden = 0;
if (s->parent != NULL)
uiContainerUpdate(s->parent);
s->hidden = 0;
}
static void singleHide(uiControl *c)
@ -83,9 +83,9 @@ static void singleHide(uiControl *c)
singleHWND *s = (singleHWND *) (c->Internal);
ShowWindow(s->hwnd, SW_HIDE);
s->hidden = 1;
if (s->parent != NULL)
uiContainerUpdate(s->parent);
s->hidden = 1;
}
static void singleEnable(uiControl *c)