[Bf-blender-cvs] [a81b558d48e] modifier-panels-ui: Cleanup: Rename panel type flag from extend to expand

Julian Eisel noreply at git.blender.org
Tue Apr 21 12:29:51 CEST 2020


Commit: a81b558d48e411d93b0bdeb317f8d8dd0645f223
Author: Julian Eisel
Date:   Tue Apr 21 12:28:33 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBa81b558d48e411d93b0bdeb317f8d8dd0645f223

Cleanup: Rename panel type flag from extend to expand

Not sure why I used extend, probably just because of brain dead
programming :)
Also, expose the flag to python panel options.

===================================================================

M	source/blender/editors/screen/area.c
M	source/blender/makesdna/DNA_screen_types.h
M	source/blender/makesrna/intern/rna_ui.c
M	source/blender/modifiers/intern/MOD_ui_common.c

===================================================================

diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 5d88925c6fb..ceb5df9184e 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -2405,8 +2405,8 @@ static void ed_panel_draw(const bContext *C,
 
     UI_panel_label_offset(block, &labelx, &labely);
 
-    /* Unusual case: Use extending layout (buttons stretch to available width). */
-    if (pt->flag & PNL_LAYOUT_HEADER_EXTEND) {
+    /* Unusual case: Use expanding layout (buttons stretch to available width). */
+    if (pt->flag & PNL_LAYOUT_HEADER_EXPAND) {
       uiLayout *layout = UI_block_layout(block,
                                          UI_LAYOUT_VERTICAL,
                                          UI_LAYOUT_PANEL,
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index 02de4457c2d..a76d0ebcb7d 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -550,7 +550,8 @@ enum {
 enum {
   PNL_DEFAULT_CLOSED = (1 << 0),
   PNL_NO_HEADER = (1 << 1),
-  PNL_LAYOUT_HEADER_EXTEND = (1 << 2),
+  /** Makes buttons in the header shrink/stretch to fill full layout width. */
+  PNL_LAYOUT_HEADER_EXPAND = (1 << 2),
   PNL_LAYOUT_VERT_BAR = (1 << 3),
   /** This panel type represents data external to the UI. */
   PNL_LIST = (1 << 4),
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 46017bd6ab5..4a4abec62d5 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -1301,6 +1301,11 @@ static void rna_def_panel(BlenderRNA *brna)
        0,
        "List Panel Child",
        "A panel with this type is a child of a list panel"},
+      {PNL_LAYOUT_HEADER_EXPAND,
+       "HEADER_LAYOUT_EXTPAND",
+       0,
+       "Expand Header Layout",
+       "Allow buttons in the header to stretch and shrink to fill the entire layout width"},
       {0, NULL, 0, NULL, NULL},
   };
 
diff --git a/source/blender/modifiers/intern/MOD_ui_common.c b/source/blender/modifiers/intern/MOD_ui_common.c
index b798681b51e..92edf0ec681 100644
--- a/source/blender/modifiers/intern/MOD_ui_common.c
+++ b/source/blender/modifiers/intern/MOD_ui_common.c
@@ -331,7 +331,7 @@ PanelType *modifier_panel_register(ARegionType *region_type, const char *name, P
 
   /* Give the panel the special flag that says it was built here and corresponds to a
    * modifer rather than a PanelType. */
-  panel_type->flag = PNL_LAYOUT_HEADER_EXTEND | PNL_LIST;
+  panel_type->flag = PNL_LAYOUT_HEADER_EXPAND | PNL_LIST;
   panel_type->reorder = modifier_reorder;
   panel_type->get_list_data_expand_flag = get_modifier_expand_flag;
   panel_type->set_list_data_expand_flag = set_modifier_expand_flag;



More information about the Bf-blender-cvs mailing list