From 9d28353b525ecfbcca1501be72e4276dfb2bbc2a Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Fri, 13 Nov 2020 13:56:55 -0500 Subject: Cleanup: Make panel type flag names more clear The overlap with the `Panel` flags that start with "PNL" was quite confusing because wasn't clear which enum a flag was from. The new names are a bit longer, but the clarity is worth it. --- source/blender/editors/screen/area.c | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'source/blender/editors/screen/area.c') diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 720d4608125..ce049cfcaac 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -2631,7 +2631,7 @@ static void ed_panel_draw(const bContext *C, int headerend = w - UI_UNIT_X; UI_panel_header_buttons_begin(panel); - if (pt->draw_header_preset && !(pt->flag & PNL_NO_HEADER)) { + if (pt->draw_header_preset && !(pt->flag & PANEL_TYPE_NO_HEADER)) { /* for preset menu */ panel->layout = UI_block_layout(block, UI_LAYOUT_HORIZONTAL, @@ -2651,12 +2651,12 @@ static void ed_panel_draw(const bContext *C, panel->layout = NULL; } - if (pt->draw_header && !(pt->flag & PNL_NO_HEADER)) { + if (pt->draw_header && !(pt->flag & PANEL_TYPE_NO_HEADER)) { int labelx, labely; UI_panel_label_offset(block, &labelx, &labely); /* Unusual case: Use expanding layout (buttons stretch to available width). */ - if (pt->flag & PNL_LAYOUT_HEADER_EXPAND) { + if (pt->flag & PANEL_TYPE_HEADER_EXPAND) { uiLayout *layout = UI_block_layout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, @@ -2690,7 +2690,7 @@ static void ed_panel_draw(const bContext *C, short panelContext; /* panel context can either be toolbar region or normal panels region */ - if (pt->flag & PNL_LAYOUT_VERT_BAR) { + if (pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) { panelContext = UI_LAYOUT_VERT_BAR; } else if (region->regiontype == RGN_TYPE_TOOLS) { @@ -2700,16 +2700,16 @@ static void ed_panel_draw(const bContext *C, panelContext = UI_LAYOUT_PANEL; } - panel->layout = UI_block_layout(block, - UI_LAYOUT_VERTICAL, - panelContext, - (pt->flag & PNL_LAYOUT_VERT_BAR) ? 0 : style->panelspace, - 0, - (pt->flag & PNL_LAYOUT_VERT_BAR) ? 0 : - w - 2 * style->panelspace, - em, - 0, - style); + panel->layout = UI_block_layout( + block, + UI_LAYOUT_VERTICAL, + panelContext, + (pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) ? 0 : style->panelspace, + 0, + (pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) ? 0 : w - 2 * style->panelspace, + em, + 0, + style); pt->draw(C, panel); @@ -2888,7 +2888,7 @@ void ED_region_panels_layout_ex(const bContext *C, for (LinkNode *pt_link = panel_types_stack; pt_link; pt_link = pt_link->next) { PanelType *pt = pt_link->link; - if (pt->flag & PNL_INSTANCED) { + if (pt->flag & PANEL_TYPE_INSTANCED) { has_instanced_panel = true; continue; } @@ -2910,7 +2910,7 @@ void ED_region_panels_layout_ex(const bContext *C, ®ion->panels, pt, panel, - (pt->flag & PNL_DRAW_BOX) ? w_box_panel : w, + (pt->flag & PANEL_TYPE_DRAW_BOX) ? w_box_panel : w, em, NULL, search_filter); @@ -2922,7 +2922,7 @@ void ED_region_panels_layout_ex(const bContext *C, if (panel->type == NULL) { continue; /* Some panels don't have a type. */ } - if (!(panel->type->flag & PNL_INSTANCED)) { + if (!(panel->type->flag & PANEL_TYPE_INSTANCED)) { continue; } if (use_category_tabs && panel->type->category[0] && @@ -2944,7 +2944,7 @@ void ED_region_panels_layout_ex(const bContext *C, ®ion->panels, panel->type, panel, - (panel->type->flag & PNL_DRAW_BOX) ? w_box_panel : w, + (panel->type->flag & PANEL_TYPE_DRAW_BOX) ? w_box_panel : w, em, unique_panel_str, search_filter); @@ -3165,7 +3165,7 @@ bool ED_region_property_search(const bContext *C, for (LinkNode *pt_link = panel_types_stack; pt_link; pt_link = pt_link->next) { PanelType *panel_type = pt_link->link; /* Note that these checks are duplicated from #ED_region_panels_layout_ex. */ - if (panel_type->flag & PNL_INSTANCED) { + if (panel_type->flag & PANEL_TYPE_INSTANCED) { has_instanced_panel = true; continue; } @@ -3188,7 +3188,7 @@ bool ED_region_property_search(const bContext *C, if (!has_result && has_instanced_panel) { LISTBASE_FOREACH (Panel *, panel, ®ion->panels) { /* Note that these checks are duplicated from #ED_region_panels_layout_ex. */ - if (panel->type == NULL || !(panel->type->flag & PNL_INSTANCED)) { + if (panel->type == NULL || !(panel->type->flag & PANEL_TYPE_INSTANCED)) { continue; } if (use_category_tabs) { -- cgit v1.2.3