Fix for a nasty glicth found by Irie Shinsuke in Freestyle branch.

Headerless panels are not supposed to be closed ever. But if user saves a blend with a stardard panel closed, then dev decides to make this panel headerless, when user open again its blend, the panel is closed and has no more header, so it becomes invisible!

This commit simply checks, at draw time, that a headerless panel is never closed (and repoen it if necessary)!
This commit is contained in:
Bastien Montagne 2013-01-28 08:58:20 +00:00
parent 2e822e30b1
commit 9b2c0f03dd

@ -247,6 +247,14 @@ Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, int
}
}
/* Do not allow closed panels without headers! Else user could get "disappeared" UI! */
if ((pt->flag & PNL_NO_HEADER) && (pa->flag & PNL_CLOSED)) {
pa->flag &= ~PNL_CLOSED;
/* Force update of panels' positions! */
pa->sizex = 0;
pa->sizey = 0;
}
BLI_strncpy(pa->drawname, drawname, UI_MAX_NAME_STR);
/* if a new panel is added, we insert it right after the panel