Fix for a nasty glicth found by Irie Shinsuke in Freestyle branch.
authorBastien Montagne <montagne29@wanadoo.fr>
Mon, 28 Jan 2013 08:58:20 +0000 (08:58 +0000)
committerBastien Montagne <montagne29@wanadoo.fr>
Mon, 28 Jan 2013 08:58:20 +0000 (08:58 +0000)
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)!

source/blender/editors/interface/interface_panel.c

index 00c45e4158782678821282462da30b9fad71c32b..c2c1de9cbd7620f4997675affcc23da2d7060ac4 100644 (file)
@@ -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