diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-06-25 13:14:38 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-06-25 13:15:12 +0300 |
commit | 0145daa09bba74df474f0626fac8372c0a7e2b90 (patch) | |
tree | bf52b4aac6de4e063cd37359f0795fb0d12e3533 | |
parent | 861b0ec4170958814955eadf49c36109eacf9972 (diff) |
Outliner: Make search always work
This was a flag in early 2.8 to allow users to hide the entire search prop.
Now since we want it fully expanded at all times, it makes no more sense.
6 files changed, 8 insertions, 17 deletions
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index e8ae36aa3fc..df48d17274d 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -43,10 +43,7 @@ class OUTLINER_HT_header(Header): layout.separator_spacer() row = layout.row(align=True) - row.prop(space, "use_filter_search", text="") - sub = row.row(align=True) - sub.prop(space, "filter_text", text="") - sub.enabled = space.use_filter_search + row.prop(space, "filter_text", icon='VIEWZOOM', text="") layout.separator_spacer() diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 64a9c901175..5d2be638964 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -1960,7 +1960,6 @@ static void outliner_draw_highlights_recursive( const bool is_searching = ( SEARCHING_OUTLINER(soops) || (soops->outlinevis == SO_DATA_API && - (soops->filter & SO_FILTER_SEARCH) && soops->search_string[0] != 0)); for (TreeElement *te = lb->first; te; te = te->next) { diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index 1f8320f73a0..0ab22208841 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -182,7 +182,7 @@ typedef enum { * - not searching into RNA items helps but isn't the complete solution */ -#define SEARCHING_OUTLINER(sov) ((sov->search_flags & SO_SEARCH_RECURSIVE) && (sov->filter & SO_FILTER_SEARCH)) +#define SEARCHING_OUTLINER(sov) (sov->search_flags & SO_SEARCH_RECURSIVE) /* is the currrent element open? if so we also show children */ #define TSELEM_OPEN(telm, sv) ( (telm->flag & TSE_CLOSED) == 0 || (SEARCHING_OUTLINER(sv) && (telm->flag & TSE_CHILDSEARCH)) ) diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 01df653c86d..63312561678 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -1892,10 +1892,11 @@ static int outliner_exclude_filter_get(SpaceOops *soops) { int exclude_filter = soops->filter & ~SO_FILTER_OB_STATE; - if (soops->filter & SO_FILTER_SEARCH) { - if (soops->search_string[0] == 0) { - exclude_filter &= ~SO_FILTER_SEARCH; - } + if (soops->search_string[0] != 0) { + exclude_filter |= SO_FILTER_SEARCH; + } + else { + exclude_filter &= ~SO_FILTER_SEARCH; } /* Let's have this for the collection options at first. */ diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 4f07a30ed70..bbfbf660774 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -274,7 +274,7 @@ typedef enum eSpaceOutliner_Flag { /* SpaceOops.filter */ typedef enum eSpaceOutliner_Filter { - SO_FILTER_SEARCH = (1 << 0), + SO_FILTER_SEARCH = (1 << 0), /* Run-time flag. */ /* SO_FILTER_ENABLE = (1 << 1), */ /* Deprecated */ SO_FILTER_NO_OBJECT = (1 << 2), SO_FILTER_NO_OB_CONTENT = (1 << 3), /* Not only mesh, but modifiers, constraints, ... */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 8dab3551efa..68af5795d49 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2295,12 +2295,6 @@ static void rna_def_space_outliner(BlenderRNA *brna) RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); /* Filters. */ - prop = RNA_def_property(srna, "use_filter_search", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "filter", SO_FILTER_SEARCH); - RNA_def_property_ui_text(prop, "Search Name", "Filter searched elements"); - RNA_def_property_ui_icon(prop, ICON_VIEWZOOM, 0); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); - prop = RNA_def_property(srna, "use_filter_object", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OBJECT); RNA_def_property_ui_text(prop, "Filter Objects", "Show objects"); |