From 9b2c0f03dd64f2c3c5dc41a1d2e388acf53983d0 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 28 Jan 2013 08:58:20 +0000 Subject: [PATCH] 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)! --- source/blender/editors/interface/interface_panel.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 00c45e41587..c2c1de9cbd7 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -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