Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2020-09-15 01:33:45 +0300
committerHans Goudey <h.goudey@me.com>2020-09-15 01:33:45 +0300
commitfd89ef4d2f58eb0dd5c8a7a4d0ad500dcc0f9dee (patch)
tree48f932ef744d107816639f4e28216f0db466dda2
parentdcfbee5c8075c6513c380401f5e53446cd55dd1e (diff)
parent572ce24f7e2c7744d32747069497d5a369c2ea48 (diff)
Merge branch 'property-search-start-end-operators' into property-search-highlight-tabs
-rw-r--r--source/blender/editors/include/UI_interface.h3
-rw-r--r--source/blender/editors/interface/interface.c5
-rw-r--r--source/blender/editors/interface/interface_layout.c6
-rw-r--r--source/blender/editors/screen/area.c6
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c3
5 files changed, 10 insertions, 13 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 67422e4cfd4..f02c34c4085 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -674,7 +674,6 @@ enum {
void UI_block_theme_style_set(uiBlock *block, char theme_style);
char UI_block_emboss_get(uiBlock *block);
void UI_block_emboss_set(uiBlock *block, char emboss);
-bool UI_block_has_search_filter(const uiBlock *block);
bool UI_block_is_search_only(const uiBlock *block);
void UI_block_set_search_only(uiBlock *block, bool search_only);
void UI_block_set_search_filter(uiBlock *block, const char *search_filter);
@@ -1871,7 +1870,7 @@ uiLayout *UI_block_layout(uiBlock *block,
void UI_block_layout_set_current(uiBlock *block, uiLayout *layout);
void UI_block_layout_resolve(uiBlock *block, int *r_x, int *r_y);
-void UI_block_apply_search_filter(uiBlock *block);
+bool UI_block_apply_search_filter(uiBlock *block);
void UI_region_message_subscribe(struct ARegion *region, struct wmMsgBus *mbus);
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 98140a2c058..8aa25100b0b 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -3509,11 +3509,6 @@ void UI_block_theme_style_set(uiBlock *block, char theme_style)
block->theme_style = theme_style;
}
-bool UI_block_has_search_filter(const uiBlock *block)
-{
- return block->search_filter != NULL && block->search_filter[0] != '\0';
-}
-
bool UI_block_is_search_only(const uiBlock *block)
{
return block->flag & UI_BLOCK_SEARCH_ONLY;
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 794cb53d5da..213917929e3 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -5311,10 +5311,10 @@ static void block_search_deactivate_buttons(uiBlock *block)
*
* \note Must be run before #UI_block_layout_resolve.
*/
-void UI_block_apply_search_filter(uiBlock *block)
+bool UI_block_apply_search_filter(uiBlock *block)
{
if (!(block->search_filter && block->search_filter[0])) {
- return;
+ return false;
}
const bool panel_label_matches = block_search_panel_label_matches(block);
@@ -5330,6 +5330,8 @@ void UI_block_apply_search_filter(uiBlock *block)
if (!panel_label_matches) {
block_search_deactivate_buttons(block);
}
+
+ return has_result;
}
/** \} */
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 81150d78c9e..bc60bf32635 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -2610,6 +2610,8 @@ static void ed_panel_draw(const bContext *C,
bool open;
panel = UI_panel_begin(region, lb, block, pt, panel, &open);
+ const bool search_filter_active = search_filter != NULL && search_filter[0] != '\0';
+
/* bad fixed values */
int xco, yco, h = 0;
int headerend = w - UI_UNIT_X;
@@ -2670,7 +2672,7 @@ static void ed_panel_draw(const bContext *C,
panel->labelofs = 0;
}
- if (open || UI_block_has_search_filter(block) || search_only) {
+ if (open || search_filter_active) {
short panelContext;
/* panel context can either be toolbar region or normal panels region */
@@ -2710,7 +2712,7 @@ static void ed_panel_draw(const bContext *C,
UI_block_end(C, block);
/* Draw child panels. */
- if (open || UI_block_has_search_filter(block)) {
+ if (open || search_filter_active) {
LISTBASE_FOREACH (LinkData *, link, &pt->children) {
PanelType *child_pt = link->data;
Panel *child_panel = UI_panel_find_by_type(&panel->children, child_pt);
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index 147c3175d33..039439583aa 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -110,8 +110,7 @@ static void buttons_free(SpaceLink *sl)
MEM_freeN(ct);
}
- BLI_assert(sbuts->runtime != NULL);
- MEM_freeN(sbuts->runtime);
+ MEM_SAFE_FREE(sbuts->runtime);
}
/* spacetype; init callback */