From 6250a8725ed6a2d9d85f4d313e9931c2fe4a8de3 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 29 Oct 2020 19:34:29 -0500 Subject: Cleanup: Use an enum to set instanced panel expansion This commit uses an enum to access expansion for specific panels for each modifier, constraint, etc. Even though these values are quite simple, this can help make the code more explicit when the ui_expand_flag is accessed directly. Also update comments about this bitfield to make them consistent. --- source/blender/blenkernel/intern/constraint.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/blenkernel/intern/constraint.c') diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 2301267cd21..d21529467a1 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -45,6 +45,7 @@ #include "DNA_meshdata_types.h" #include "DNA_modifier_types.h" #include "DNA_object_types.h" +#include "DNA_screen_types.h" #include "DNA_lattice_types.h" #include "DNA_movieclip_types.h" @@ -5408,7 +5409,7 @@ bool BKE_constraint_remove_ex(ListBase *list, Object *ob, bConstraint *con, bool void BKE_constraint_panel_expand(bConstraint *con) { - con->ui_expand_flag |= (1 << 0); + con->ui_expand_flag |= UI_PANEL_DATA_EXPAND_ROOT; } /* ......... */ @@ -5426,10 +5427,10 @@ static bConstraint *add_new_constraint_internal(const char *name, short type) con->enforce = 1.0f; /* Only open the main panel when constraints are created, not the sub-panels. */ - con->ui_expand_flag = (1 << 0); + con->ui_expand_flag = UI_PANEL_DATA_EXPAND_ROOT; if (ELEM(type, CONSTRAINT_TYPE_ACTION, CONSTRAINT_TYPE_SPLINEIK)) { /* Expand the two sub-panels in the cases where the main panel barely has any properties. */ - con->ui_expand_flag |= (1 << 1) | (1 << 2); + con->ui_expand_flag |= UI_SUBPANEL_DATA_EXPAND_1 | UI_SUBPANEL_DATA_EXPAND_2; } /* Determine a basic name, and info */ -- cgit v1.2.3