diff options
author | Hans Goudey <h.goudey@me.com> | 2020-08-12 19:56:10 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-08-12 19:56:10 +0300 |
commit | 1da053956a920c34324917becbfe1455b929c824 (patch) | |
tree | 4823a94ba21015edd1e3275cf479e7c1f004fb86 /source/blender/editors/screen/area.c | |
parent | 6238eabcd4340893c1c52dcd9a0ffbc7658abe67 (diff) |
UI: Category support for instanced panels
This adds support for panel categories to the instanced panel system
used for modifiers and others. The change is pulled from D7997 where
it is needed for FCurve modifiers, but it is unused now.
The change is simple and basically amounts to checking the panel
category where it was overlooked before.
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r-- | source/blender/editors/screen/area.c | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 58fb934ebf0..38bac3afef6 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -2658,29 +2658,35 @@ void ED_region_panels_layout_ex(const bContext *C, if (has_instanced_panel) { LISTBASE_FOREACH (Panel *, panel, ®ion->panels) { if (panel->type == NULL) { - continue; /* Some panels don't have a type.. */ + continue; /* Some panels don't have a type. */ } - if (panel->type->flag & PNL_INSTANCED) { - if (panel && UI_panel_is_dragging(panel)) { - /* Prevent View2d.tot rectangle size changes while dragging panels. */ - update_tot_size = false; - } - - /* Use a unique identifier for instanced panels, otherwise an old block for a different - * panel of the same type might be found. */ - char unique_panel_str[8]; - UI_list_panel_unique_str(panel, unique_panel_str); - ed_panel_draw(C, - area, - region, - ®ion->panels, - panel->type, - panel, - (panel->type->flag & PNL_DRAW_BOX) ? w_box_panel : w, - em, - vertical, - unique_panel_str); + if (!(panel->type->flag & PNL_INSTANCED)) { + continue; } + if (use_category_tabs && panel->type->category[0] && + !STREQ(category, panel->type->category)) { + continue; + } + + if (panel && UI_panel_is_dragging(panel)) { + /* Prevent View2d.tot rectangle size changes while dragging panels. */ + update_tot_size = false; + } + + /* Use a unique identifier for instanced panels, otherwise an old block for a different + * panel of the same type might be found. */ + char unique_panel_str[8]; + UI_list_panel_unique_str(panel, unique_panel_str); + ed_panel_draw(C, + area, + region, + ®ion->panels, + panel->type, + panel, + (panel->type->flag & PNL_DRAW_BOX) ? w_box_panel : w, + em, + vertical, + unique_panel_str); } } |