[Bf-blender-cvs] [ba2eef2f6fb] property-search-ui-v2: Property Search: Remove code for changing to search layout

Hans Goudey noreply at git.blender.org
Thu Jul 30 18:29:06 CEST 2020


Commit: ba2eef2f6fb7cc0c48353081417a39699c8b4a1b
Author: Hans Goudey
Date:   Thu Jul 30 12:29:14 2020 -0400
Branches: property-search-ui-v2
https://developer.blender.org/rBba2eef2f6fb7cc0c48353081417a39699c8b4a1b

Property Search: Remove code for changing to search layout

The design for this task has changed so that the layouts won't be changed
to only list the matching properties. Instead we will use highlights to
communicate matching properties.

After this commit property search doesn't do anything visible.
Functionality will be added back in future commits.

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

M	release/scripts/startup/bl_ui/properties_constraint.py
M	release/scripts/startup/bl_ui/properties_data_modifier.py
M	source/blender/editors/include/UI_interface.h
M	source/blender/editors/interface/interface_layout.c
M	source/blender/editors/interface/interface_panel.c
M	source/blender/editors/screen/area.c
M	source/blender/makesrna/intern/rna_ui.c

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

diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py
index f5177b81c95..215c96a5975 100644
--- a/release/scripts/startup/bl_ui/properties_constraint.py
+++ b/release/scripts/startup/bl_ui/properties_constraint.py
@@ -44,7 +44,6 @@ class OBJECT_PT_constraints(ObjectConstraintPanel):
 
     def draw(self, context):
         layout = self.layout
-        layout.use_property_search = False
 
         layout.operator_menu_enum("object.constraint_add", "type", text="Add Object Constraint")
 
@@ -59,7 +58,6 @@ class BONE_PT_constraints(BoneConstraintPanel):
 
     def draw(self, context):
         layout = self.layout
-        layout.use_property_search = False
 
         layout.operator_menu_enum("pose.constraint_add", "type", text="Add Bone Constraint")
 
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 10f954a604b..d464a3ffc6b 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -39,7 +39,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
-        layout.use_property_search = False
         layout.operator_menu_enum("object.modifier_add", "type")
         layout.template_modifiers()
 
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 2cb4cca9f84..e62e84142ea 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -1907,7 +1907,6 @@ void uiLayoutSetUnitsY(uiLayout *layout, float unit);
 void uiLayoutSetEmboss(uiLayout *layout, char emboss);
 void uiLayoutSetPropSep(uiLayout *layout, bool is_sep);
 void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep);
-void uiLayoutSetPropSearch(uiLayout *layout, bool is_searchable);
 int uiLayoutGetLocalDir(const uiLayout *layout);
 
 int uiLayoutGetOperatorContext(uiLayout *layout);
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 2608e4b5060..41bb7127c32 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -145,7 +145,6 @@ enum {
    * Enabled by default, depends on 'UI_ITEM_PROP_SEP'. */
   UI_ITEM_PROP_DECORATE = 1 << 5,
   UI_ITEM_PROP_DECORATE_NO_PAD = 1 << 6,
-  UI_ITEM_USE_SEARCH_FILTER = 1 << 7,
 };
 
 typedef struct uiButtonItem {
@@ -182,8 +181,6 @@ struct uiLayout {
   char emboss;
   /** for fixed width or height to avoid UI size changes */
   float units[2];
-
-  bool property_search_layout_temp_debug;
 };
 
 typedef struct uiLayoutItemFlow {
@@ -831,8 +828,7 @@ static void ui_item_enum_expand_exec(uiLayout *layout,
    *   this doubles the icon_only parameter.
    * - we *never* draw (i.e. really use) the enum label uiname, it is just used as a mere flag!
    *
-   * Unfortunately, fixing this implies an API "soft break", so better to defer it for later...
-   * :/
+   * Unfortunately, fixing this implies an API "soft break", so better to defer it for later... :/
    * - mont29
    */
 
@@ -1994,8 +1990,8 @@ static uiBut *ui_layout_heading_label_add(uiLayout *layout,
  */
 static uiLayout *ui_item_prop_split_layout_hack(uiLayout *layout_parent, uiLayout *layout_split)
 {
-  /* Tag item as using property split layout, this is inherited to children so they can get
-   * special treatment if needed. */
+  /* Tag item as using property split layout, this is inherited to children so they can get special
+   * treatment if needed. */
   layout_parent->item.flag |= UI_ITEM_INSIDE_PROP_SEP;
 
   if (layout_parent->item.type == ITEM_LAYOUT_ROW) {
@@ -2021,9 +2017,9 @@ void uiItemFullR(uiLayout *layout,
   char namestr[UI_MAX_NAME_STR];
   const bool use_prop_sep = ((layout->item.flag & UI_ITEM_PROP_SEP) != 0);
   const bool inside_prop_sep = ((layout->item.flag & UI_ITEM_INSIDE_PROP_SEP) != 0);
-  /* Columns can define a heading to insert. If the first item added to a split layout doesn't
-   * have a label to display in the first column, the heading is inserted there. Otherwise it's
-   * inserted as a new row before the first item. */
+  /* Columns can define a heading to insert. If the first item added to a split layout doesn't have
+   * a label to display in the first column, the heading is inserted there. Otherwise it's inserted
+   * as a new row before the first item. */
   uiLayout *heading_layout = ui_layout_heading_find(layout);
   /* Although checkboxes use the split layout, they are an exception and should only place their
    * label in the second column, to not make that almost empty.
@@ -2257,12 +2253,6 @@ void uiItemFullR(uiLayout *layout,
         label_added = true;
       }
 
-      /* Add an empty label button so the empty column isn't removed during property search. */
-      if (!label_added && !use_prop_sep_split_label) {
-        label_but = uiItemL_(layout_sub, "", ICON_NONE);
-        label_added = true;
-      }
-
       layout_split = ui_item_prop_split_layout_hack(layout_parent, layout_split);
 
       /* Watch out! We can only write into the new layout now. */
@@ -4739,8 +4729,8 @@ static void ui_litem_init_from_parent(uiLayout *litem, uiLayout *layout, int ali
   litem->redalert = layout->redalert;
   litem->w = layout->w;
   litem->emboss = layout->emboss;
-  litem->item.flag = (layout->item.flag & (UI_ITEM_PROP_SEP | UI_ITEM_PROP_DECORATE |
-                                           UI_ITEM_INSIDE_PROP_SEP | UI_ITEM_USE_SEARCH_FILTER));
+  litem->item.flag = (layout->item.flag &
+                      (UI_ITEM_PROP_SEP | UI_ITEM_PROP_DECORATE | UI_ITEM_INSIDE_PROP_SEP));
 
   if (layout->child_items_layout) {
     BLI_addtail(&layout->child_items_layout->items, litem);
@@ -5082,16 +5072,6 @@ void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
   SET_FLAG_FROM_TEST(layout->item.flag, is_sep, UI_ITEM_PROP_DECORATE);
 }
 
-bool uiLayoutGetPropSearch(uiLayout *layout)
-{
-  return (layout->item.flag & UI_ITEM_USE_SEARCH_FILTER) != 0;
-}
-
-void uiLayoutSetPropSearch(uiLayout *layout, bool is_searchable)
-{
-  SET_FLAG_FROM_TEST(layout->item.flag, is_searchable, UI_ITEM_USE_SEARCH_FILTER);
-}
-
 bool uiLayoutGetActive(uiLayout *layout)
 {
   return layout->active;
@@ -5173,146 +5153,9 @@ void uiLayoutRootSetSearchOnly(uiLayout *layout, bool search_only)
 
 // #define PROPERTY_SEARCH_USE_TOOLTIPS
 // #define PROPERTY_SEARCH_USE_PANEL_LABELS
-#define DEBUG_LAYOUT_ROOTS
 
 static void ui_layout_free(uiLayout *layout);
 
-#ifdef DEBUG_LAYOUT_ROOTS
-
-/* clang-format off */
-static const char *but_type_string(eButType type) {
-  switch (type) {
-    case UI_BTYPE_BUT: return "But";
-    case UI_BTYPE_ROW: return "Row But";
-    case UI_BTYPE_TEXT: return "Text";
-    case UI_BTYPE_MENU: return "Menu";
-    case UI_BTYPE_BUT_MENU: return "But Menu";
-    case UI_BTYPE_NUM: return "Number";
-    case UI_BTYPE_NUM_SLIDER: return "Number Slider";
-    case UI_BTYPE_TOGGLE: return "Toggle";
-    case UI_BTYPE_TOGGLE_N: return "Toggle N";
-    case UI_BTYPE_ICON_TOGGLE: return "Icon Toggle";
-    case UI_BTYPE_ICON_TOGGLE_N: return "Icon Toggle N";
-    case UI_BTYPE_BUT_TOGGLE: return "But Toggle";
-    case UI_BTYPE_CHECKBOX: return "Checkbox";
-    case UI_BTYPE_CHECKBOX_N: return "Checkbox N";
-    case UI_BTYPE_COLOR: return "Color";
-    case UI_BTYPE_TAB: return "Tab";
-    case UI_BTYPE_POPOVER: return "Popover";
-    case UI_BTYPE_SCROLL: return "Scroll";
-    case UI_BTYPE_BLOCK: return "Block";
-    case UI_BTYPE_LABEL: return "Label";
-    case UI_BTYPE_KEY_EVENT: return "Key Event";
-    case UI_BTYPE_HSVCUBE: return "HSV Cube";
-    case UI_BTYPE_PULLDOWN: return "Pulldown";
-    case UI_BTYPE_ROUNDBOX: return "Roundbox";
-    case UI_BTYPE_COLORBAND: return "Colorband";
-    case UI_BTYPE_UNITVEC: return "Unit Vector";
-    case UI_BTYPE_CURVE: return "Curve";
-    case UI_BTYPE_CURVEPROFILE: return "Curve Profile";
-    case UI_BTYPE_LISTBOX: return "Listbox";
-    case UI_BTYPE_LISTROW: return "List Row";
-    case UI_BTYPE_HSVCIRCLE: return "HSV Circle";
-    case UI_BTYPE_TRACK_PREVIEW: return "Track Preview";
-    case UI_BTYPE_SEARCH_MENU: return "Search Menu";
-    case UI_BTYPE_EXTRA: return "Extra";
-    case UI_BTYPE_HOTKEY_EVENT: return "Hotkey Event";
-    case UI_BTYPE_IMAGE: return "Image";
-    case UI_BTYPE_HISTOGRAM: return "Histogram";
-    case UI_BTYPE_WAVEFORM: return "Waveform";
-    case UI_BTYPE_VECTORSCOPE: return "Vectorscope";
-    case UI_BTYPE_PROGRESS_BAR: return "Progress Bar";
-    case UI_BTYPE_NODE_SOCKET: return "Node Socket";
-    case UI_BTYPE_SEPR: return "Spacer";
-    case UI_BTYPE_SEPR_LINE: return "Spacer Line";
-    case UI_BTYPE_SEPR_SPACER: return "Dynamic Spacer";
-    case UI_BTYPE_GRIP: return "Grip";
-    default: return "Unkown Button Type";
-  }         
-}
-/* clang-format on */
-
-/* Keep order the same as enum above. */
-const char *item_type_names[12] = {
-    "Button",      /* ITEM_BUTTON */
-    "Row",         /* ITEM_LAYOUT_ROW */
-    "Column",      /* ITEM_LAYOUT_COLUMN */
-    "Column Flow", /* ITEM_LAYOUT_COLUMN_FLOW */
-    "Row Flow",    /* ITEM_LAYOUT_ROW_FLOW */
-    "Grid Flow",   /* ITEM_LAYOUT_GRID_FLOW */
-    "Box",         /* ITEM_LAYOUT_BOX */
-    "Absolute",    /* ITEM_LAYOUT_ABSOLUTE */
-    "Split",       /* ITEM_LAYOUT_SPLIT */
-    "Overlap",     /* ITEM_LAYOUT_OVERLAP */
-    "Radial",      /* ITEM_LAYOUT_RADIAL */
-    "Root",        /* ITEM_LAYOUT_ROOT */
-};
-
-#  define PRINT_DEFAULT "\x1B[0m"
-#  define PRINT_GREEN "\x1B[32m"
-#  define PRINT_RED "\x1B[31m"
-#  define PRINT_WHITE "\x1B[37m"
-static void debug_print_button_item(uiButtonItem *button_item)
-{
-  uiBut *but = button_item->but;
-
-  if (but == NULL) {
-    printf("NULL BUT");
-    return;
-  }
-
-  printf("%s%s%s: ", PRINT_RED, but_type_string(but->type), PRINT_DEFAULT);
-
-  if (but->str && but->str[0]) {
-    printf(but->str);
-  }
-  else if (!RNA_pointer_is_null(&but->rnapoin)) {
-    printf(RNA_property_ui_name(but->rnaprop));
-  }
-}
-
-

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list