[Bf-blender-cvs] [bee91a5a5a7] filebrowser_redesign: Remove 'HIDDEN' panel flag, use existing convention
Julian Eisel
noreply at git.blender.org
Sun Sep 1 14:05:11 CEST 2019
Commit: bee91a5a5a7d3025d43d4c5913adc8601f1cd1b1
Author: Julian Eisel
Date: Sun Sep 1 13:54:17 2019 +0200
Branches: filebrowser_redesign
https://developer.blender.org/rBbee91a5a5a7d3025d43d4c5913adc8601f1cd1b1
Remove 'HIDDEN' panel flag, use existing convention
Existing convention is to register the panels for a header, which means
they're not drawn by default anyway.
===================================================================
M release/scripts/startup/bl_ui/space_filebrowser.py
M source/blender/editors/interface/interface_panel.c
M source/blender/editors/screen/area.c
M source/blender/makesdna/DNA_screen_types.h
M source/blender/makesrna/intern/rna_ui.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py
index cb9b7f80c9f..888cef50301 100644
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@ -43,9 +43,8 @@ class FILEBROWSER_HT_header(Header):
class FILEBROWSER_PT_display(Panel):
bl_space_type = 'FILE_BROWSER'
- bl_region_type = 'UI'
+ bl_region_type = 'HEADER'
bl_label = "Display"
- bl_options = {'HIDDEN'}
@classmethod
def poll(cls, context):
@@ -83,9 +82,8 @@ class FILEBROWSER_PT_display(Panel):
class FILEBROWSER_PT_filter(Panel):
bl_space_type = 'FILE_BROWSER'
- bl_region_type = 'UI'
+ bl_region_type = 'HEADER'
bl_label = "Filter"
- bl_options = {'HIDDEN'}
@classmethod
def poll(cls, context):
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 1115a791692..5f1f972ce1e 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -245,10 +245,6 @@ static void panels_collapse_all(ScrArea *sa, ARegion *ar, const Panel *from_pa)
for (pa = ar->panels.first; pa; pa = pa->next) {
PanelType *pt = pa->type;
- if (pt->flag & PNL_HIDDEN) {
- continue;
- }
-
/* close panels with headers in the same context */
if (pt && from_pt && !(pt->flag & PNL_NO_HEADER)) {
if (!pt->context[0] || !from_pt->context[0] || STREQ(pt->context, from_pt->context)) {
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index ed98cc5ec7d..b0c9e3b9378 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -2416,10 +2416,6 @@ void ED_region_panels_layout_ex(const bContext *C,
PanelType *pt = pt_link->link;
Panel *panel = UI_panel_find_by_type(&ar->panels, pt);
- if (pt->flag & PNL_HIDDEN) {
- continue;
- }
-
if (use_category_tabs && pt->category[0] && !STREQ(category, pt->category)) {
if ((panel == NULL) || ((panel->flag & PNL_PIN) == 0)) {
continue;
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index 9c9437f8958..aab71c15e44 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -526,13 +526,10 @@ enum {
/* #define PNL_SNAP_DIST 9.0 */
-/* PanelType.flag */
-enum {
- PNL_DEFAULT_CLOSED = (1 << 0),
- PNL_NO_HEADER = (1 << 1),
- PNL_LAYOUT_VERT_BAR = (1 << 2),
- PNL_HIDDEN = (1 << 3),
-};
+/* paneltype flag */
+#define PNL_DEFAULT_CLOSED 1
+#define PNL_NO_HEADER 2
+#define PNL_LAYOUT_VERT_BAR 4
/* Fallback panel category (only for old scripts which need updating) */
#define PNL_CATEGORY_FALLBACK "Misc"
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index a835974f2c9..8c66d40342e 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -1290,12 +1290,6 @@ static void rna_def_panel(BlenderRNA *brna)
"Hide Header",
"If set to False, the panel shows a header, which contains a clickable "
"arrow to collapse the panel and the label (see bl_label)"},
- {PNL_HIDDEN,
- "HIDDEN",
- 0,
- "Hidden",
- "Do not show this panel, only register it for display at a non-default position (e.g. in a "
- "popup)"},
{0, NULL, 0, NULL, NULL},
};
More information about the Bf-blender-cvs
mailing list