[Bf-blender-cvs] [1f669db7ae0] modifier-panels-ui: Cleanup: Doxygen secionts, rename re_order -> reorder

Hans Goudey noreply at git.blender.org
Wed Apr 8 17:39:52 CEST 2020


Commit: 1f669db7ae0e2177f2f71c40aabe681e40c0d39e
Author: Hans Goudey
Date:   Tue Apr 7 17:36:24 2020 -0500
Branches: modifier-panels-ui
https://developer.blender.org/rB1f669db7ae0e2177f2f71c40aabe681e40c0d39e

Cleanup: Doxygen secionts, rename re_order -> reorder

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

M	source/blender/blenkernel/BKE_screen.h
M	source/blender/editors/interface/interface_panel.c
M	source/blender/modifiers/intern/MOD_ui_common.c

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

diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index cd4c12d836f..cc5999ca51f 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -231,7 +231,7 @@ typedef struct PanelType {
   /* For recreate panels corresponding to a list. */
 
   /** Reorder function, called when drag and drop finishes. */
-  void (*re_order)(struct bContext *C, struct Panel *pa, int new_index);
+  void (*reorder)(struct bContext *C, struct Panel *pa, int new_index);
   /**
    * Set the panel and subpanel's expansion state from the corresponding expansion flag. Called
    * on draw updates.
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 73c4c62e186..d90aa9caf73 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1473,7 +1473,7 @@ static void reorder_recreate_panel_list(bContext *C, ARegion *region, Panel *pan
     return;
   }
   /* Don't reorder if this recreate panel doesn't support drag and drop reordering. */
-  if (panel->type->re_order == NULL) {
+  if (panel->type->reorder == NULL) {
     return;
   }
 
@@ -1531,7 +1531,7 @@ static void reorder_recreate_panel_list(bContext *C, ARegion *region, Panel *pan
   panel->flag |= PNL_RECREATE_ORDER_CHANGED;
 
   /* Finally, move this panel's list item to the new index in its list. */
-  panel->type->re_order(C, panel, move_to_index);
+  panel->type->reorder(C, panel, move_to_index);
 }
 
 static void ui_do_drag(const bContext *C, const wmEvent *event, Panel *panel)
diff --git a/source/blender/modifiers/intern/MOD_ui_common.c b/source/blender/modifiers/intern/MOD_ui_common.c
index c7a92fda492..86936723524 100644
--- a/source/blender/modifiers/intern/MOD_ui_common.c
+++ b/source/blender/modifiers/intern/MOD_ui_common.c
@@ -13,6 +13,10 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
+/** \file
+ * \ingroup modifiers
+ */
+
 #include <string.h>
 
 #include "BLI_listbase.h"
@@ -53,10 +57,14 @@ static bool modifier_ui_poll(const bContext *UNUSED(C), PanelType *UNUSED(pt))
   return true;
 }
 
+/* -------------------------------------------------------------------- */
+/** \name Panel Drag and Drop, Expansion Saving
+ * \{ */
+
 /**
  * Move a modifier to the index it's moved to after a drag and drop.
  */
-static void modifier_re_order(bContext *C, Panel *panel, int new_index)
+static void modifier_reorder(bContext *C, Panel *panel, int new_index)
 {
   Object *ob = CTX_data_active_object(C);
 
@@ -125,6 +133,12 @@ static void modifier_expand_flag_set_from_panel(const bContext *C, Panel *panel)
   modifier_expand_flag_set_recursive(panel, expand_flag, 0);
 }
 
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Modifier Panel Layouts
+ * \{ */
+
 /**
  * Draw modifier error message.
  */
@@ -160,7 +174,8 @@ void modifier_panel_get_property_pointers(const bContext *C,
 #define ERROR_LIBDATA_MESSAGE TIP_("Can't edit external library data")
 void modifier_panel_buttons(const bContext *C, Panel *panel)
 {
-  uiLayout *row;
+  uiLayout *row, *sub;
+  uiBlock *block;
   uiLayout *layout = panel->layout;
 
   row = uiLayoutRow(layout, false);
@@ -168,7 +183,7 @@ void modifier_panel_buttons(const bContext *C, Panel *panel)
   Object *ob = CTX_data_active_object(C);
   ModifierData *md = BLI_findlink(&ob->modifiers, panel->runtime.list_index);
 
-  uiBlock *block = uiLayoutGetBlock(row);
+  block = uiLayoutGetBlock(row);
   UI_block_lock_set(
       block, BKE_object_obdata_is_libdata(ob) || ID_IS_LINKED(ob), ERROR_LIBDATA_MESSAGE);
 
@@ -192,7 +207,9 @@ void modifier_panel_buttons(const bContext *C, Panel *panel)
   }
   else {
     uiLayoutSetOperatorContext(row, WM_OP_INVOKE_DEFAULT);
-    uiItemEnumO(row,
+
+    sub = uiLayoutRow(row, true);
+    uiItemEnumO(sub,
                 "OBJECT_OT_modifier_apply",
                 CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Apply"),
                 0,
@@ -200,7 +217,7 @@ void modifier_panel_buttons(const bContext *C, Panel *panel)
                 MODIFIER_APPLY_DATA);
 
     if (modifier_isSameTopology(md) && !modifier_isNonGeometrical(md)) {
-      uiItemEnumO(row,
+      uiItemEnumO(sub,
                   "OBJECT_OT_modifier_apply",
                   CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Apply as Shape Key"),
                   0,
@@ -329,6 +346,12 @@ static void modifier_panel_header_modes(const bContext *C, Panel *panel)
   uiItemO(row, "", ICON_X, "OBJECT_OT_modifier_remove");
 }
 
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Modifier Registration Helpers
+ * \{ */
+
 /**
  * Create a panel in the context's region
  */
@@ -355,7 +378,7 @@ PanelType *modifier_panel_register(ARegionType *region_type, const char *name, v
   /* Give the panel the special flag that says it was built here and corresponds to a
    * modifer rather than a PanelType. */
   panel_type->flag = PANELTYPE_RECREATE;
-  panel_type->re_order = modifier_re_order;
+  panel_type->reorder = modifier_reorder;
   panel_type->set_expand_from_flag = panel_set_expand_from_flag;
   panel_type->set_expand_flag_from_panel = modifier_expand_flag_set_from_panel;
 
@@ -396,3 +419,5 @@ PanelType *modifier_subpanel_register(ARegionType *region_type,
 
   return panel_type;
 }
+
+/** \} */



More information about the Bf-blender-cvs mailing list