[Bf-blender-cvs] [85fe4a18e84] property-search-ui: Property Search: Various small cleanups
Hans Goudey
noreply at git.blender.org
Wed Jun 17 17:20:12 CEST 2020
Commit: 85fe4a18e84aeefe5104213889c256ab76d060ac
Author: Hans Goudey
Date: Wed Jun 17 10:21:38 2020 -0400
Branches: property-search-ui
https://developer.blender.org/rB85fe4a18e84aeefe5104213889c256ab76d060ac
Property Search: Various small cleanups
===================================================================
M source/blender/editors/interface/interface.c
M source/blender/editors/interface/interface_intern.h
M source/blender/editors/interface/interface_layout.c
M source/blender/editors/interface/interface_panel.c
M source/blender/editors/screen/area.c
===================================================================
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 629bb1d2eab..23716012a66 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1698,17 +1698,20 @@ static void ui_but_predefined_extra_operator_icons_add(uiBut *but)
void UI_block_update_from_old(const bContext *C, uiBlock *block)
{
- if (block->oldblock == NULL) {
+ uiBut *but_old;
+ uiBut *but;
+
+ if (!block->oldblock) {
return;
}
- uiBut *but_old = block->oldblock->buttons.first;
+ but_old = block->oldblock->buttons.first;
if (BLI_listbase_is_empty(&block->oldblock->butstore) == false) {
UI_butstore_update(block);
}
- for (uiBut *but = block->buttons.first; but; but = but->next) {
+ for (but = block->buttons.first; but; but = but->next) {
if (ui_but_update_from_old_block(C, block, &but, &but_old)) {
ui_but_update(but);
@@ -3364,7 +3367,6 @@ void UI_block_region_set(uiBlock *block, ARegion *region)
uiBlock *UI_block_begin(const bContext *C, ARegion *region, const char *name, short dt)
{
- // printf("UI_BLOCK_BEGIN\n");
uiBlock *block;
wmWindow *window;
Scene *scn;
@@ -3377,15 +3379,12 @@ uiBlock *UI_block_begin(const bContext *C, ARegion *region, const char *name, sh
block->active = 1;
block->dt = dt;
block->evil_C = (void *)C; /* XXX */
+
+ /* Set the search filter int he properties area. */
if ((region && region->regiontype == RGN_TYPE_WINDOW) &&
(area && area->spacetype == SPACE_PROPERTIES)) {
- /* HANS-TODO: Generalize. */
SpaceProperties *sbuts = CTX_wm_space_properties(C);
block->search_filter = sbuts->search_string;
- // printf(" Adding search string: %s\n", block->search_filter);
- }
- else {
- block->search_filter = NULL;
}
if (scn) {
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index a5a471678e6..56af671b651 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -79,8 +79,7 @@ enum {
UI_HAS_ICON = (1 << 3),
UI_HIDDEN = (1 << 4),
UI_SELECT_DRAW = (1 << 5), /* Display selected, doesn't impact interaction. */
- /** Filtered by the search string */
- UI_FILTERED = (1 << 12),
+ UI_FILTERED = (1 << 12), /* Filtered by the search string, removed if in a layout. */
/* warn: rest of uiBut->flag in UI_interface.h */
};
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index d808af9f141..944c3f1e1a7 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -5073,6 +5073,7 @@ int uiLayoutGetEmboss(uiLayout *layout)
static void ui_layout_free(uiLayout *layout);
+#ifdef DEBUG_LAYOUT_ROOTS
/* Keep order the same as enum above. */
const char *item_type_names[12] = {
"Button", /* ITEM_BUTTON */
@@ -5142,6 +5143,7 @@ static void debug_print_layout(uiItem *item, int depth)
}
}
}
+#endif /* DEBUG_LAYOUT_ROOTS */
/**
* Free all layouts except if a child layout has a
@@ -5346,9 +5348,11 @@ static bool ui_block_search_layout(uiBlock *block)
}
}
- LISTBASE_FOREACH_MUTABLE (uiLayoutRoot *, root, &block->layouts) {
+#ifdef DEBUG_LAYOUT_ROOTS
+ LISTBASE_FOREACH (uiLayoutRoot *, root, &block->layouts) {
debug_print_layout((uiItem *)root->layout, 0);
}
+#endif
/* Set empty flags. */
if (block->panel != NULL) {
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 950f94b9bf8..d3601df9874 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -677,6 +677,7 @@ Panel *UI_panel_begin(ScrArea *area,
BLI_addtail(lb, panel);
}
+ panel->runtime.block = block;
/* Do not allow closed panels without headers! Else user could get "disappeared" UI! */
if ((pt->flag & PNL_NO_HEADER) && (panel->flag & PNL_CLOSED)) {
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 5e60840652d..938418939c4 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -2379,7 +2379,6 @@ static void ed_panel_draw(const bContext *C,
bool open;
panel = UI_panel_begin(area, region, lb, block, pt, panel, &open);
- panel->runtime.block = block;
/* bad fixed values */
int xco, yco, h = 0;
More information about the Bf-blender-cvs
mailing list