Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-09-04 16:38:29 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-09-04 17:06:24 +0400
commitbf54ed0c7c097f1af3e73d07bb4bb32066f649ea (patch)
treedfcd6fca4914b146bad9f83eb09a9e8edf992f5f
parent15d39eaac12c0837f51abdb2041b306b8e9e0d26 (diff)
Fix T41704: 2.71.6 no longer reading user ui panel arrangement from earlier saved blend files.
This reverts rB52c06440d8e51c8661a679bcb33742666ce8dbf9 and rBe40d8258bb46926a1aecf51236822532397993f3 (tabname is old 2.4x tabed panels system, *not* new 2.7x tool tabs!). Also disabled (#idef'ed) everything regarding tabname/tabed panels for now, we may even remove it completely, would make things clearer imho. Note files saved with 2.71.6 up till now would have two versions of some panels in store (with two different values for their tabname), can give some order oddities in those cases, which have to be fixed by hand...
-rw-r--r--source/blender/editors/interface/interface_panel.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 50a190032c7..9265ca0d4b9 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -201,13 +201,19 @@ static void ui_panel_copy_offset(Panel *pa, Panel *papar)
pa->ofsy = papar->ofsy + papar->sizey - pa->sizey;
}
+
+/* XXX Disabled paneltab handling for now. Old 2.4x feature, *DO NOT* confuse it with new tool tabs in 2.70. ;)
+ * See also T41704.
+ */
+/* #define UI_USE_PANELTAB */
+
Panel *uiPanelFindByType(ARegion *ar, PanelType *pt)
{
Panel *pa;
-
const char *idname = pt->idname;
- const char *tabname = pt->category;
+#ifdef UI_USE_PANELTAB
+ const char *tabname = pt->idname;
for (pa = ar->panels.first; pa; pa = pa->next) {
if (STREQLEN(pa->panelname, idname, sizeof(pa->panelname))) {
if (STREQLEN(pa->tabname, tabname, sizeof(pa->tabname))) {
@@ -215,6 +221,13 @@ Panel *uiPanelFindByType(ARegion *ar, PanelType *pt)
}
}
}
+#else
+ for (pa = ar->panels.first; pa; pa = pa->next) {
+ if (STREQLEN(pa->panelname, idname, sizeof(pa->panelname))) {
+ return pa;
+ }
+ }
+#endif
return NULL;
}
@@ -224,11 +237,13 @@ Panel *uiPanelFindByType(ARegion *ar, PanelType *pt)
*/
Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, Panel *pa, bool *r_open)
{
- Panel *patab, *palast, *panext;
+ Panel *palast, *panext;
const char *drawname = CTX_IFACE_(pt->translation_context, pt->label);
const char *idname = pt->idname;
- const char *tabname = pt->category;
+#ifdef UI_USE_PANELTAB
+ const char *tabname = pt->idname;
const char *hookname = NULL;
+#endif
const bool newpanel = (pa == NULL);
int align = panel_aligned(sa, ar);
@@ -240,7 +255,6 @@ Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, Pan
pa = MEM_callocN(sizeof(Panel), "new panel");
pa->type = pt;
BLI_strncpy(pa->panelname, idname, sizeof(pa->panelname));
- BLI_strncpy(pa->tabname, tabname, sizeof(pa->tabname));
if (pt->flag & PNL_DEFAULT_CLOSED) {
if (align == BUT_VERTICAL)
@@ -256,9 +270,13 @@ Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, Pan
pa->runtime_flag |= PNL_NEW_ADDED;
BLI_addtail(&ar->panels, pa);
-
+
+#ifdef UI_USE_PANELTAB
+ BLI_strncpy(pa->tabname, tabname, sizeof(pa->tabname));
+
/* make new Panel tabbed? */
if (hookname) {
+ Panel *patab;
for (patab = ar->panels.first; patab; patab = patab->next) {
if ((patab->runtime_flag & PNL_ACTIVE) && patab->paneltab == NULL) {
if (STREQLEN(hookname, patab->panelname, sizeof(patab->panelname))) {
@@ -271,6 +289,9 @@ Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, Pan
}
}
}
+#else
+ BLI_strncpy(pa->tabname, idname, sizeof(pa->tabname));
+#endif
}
/* Do not allow closed panels without headers! Else user could get "disappeared" UI! */