[Bf-blender-cvs] [ef11238c743] property-search-ui: Merge branch 'master' into property-search-ui
Hans Goudey
noreply at git.blender.org
Wed Aug 12 04:13:11 CEST 2020
Commit: ef11238c743e6985fe325280fb13e05d6ec27378
Author: Hans Goudey
Date: Tue Aug 11 21:59:16 2020 -0400
Branches: property-search-ui
https://developer.blender.org/rBef11238c743e6985fe325280fb13e05d6ec27378
Merge branch 'master' into property-search-ui
===================================================================
===================================================================
diff --cc source/blender/editors/include/UI_interface.h
index a3fc66484d0,c02b4da3599..10c9c81bddb
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@@ -676,10 -670,7 +675,10 @@@ 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 dt);
+ 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_free(const struct bContext *C, uiBlock *block);
void UI_blocklist_free(const struct bContext *C, struct ListBase *lb);
diff --cc source/blender/editors/interface/interface.c
index b8c0199cd28,22fbffa9030..9ab63b4cb8f
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@@ -3366,16 -3428,9 +3429,16 @@@ uiBlock *UI_block_begin(const bContext
block = MEM_callocN(sizeof(uiBlock), "uiBlock");
block->active = 1;
- block->dt = dt;
+ block->emboss = emboss;
block->evil_C = (void *)C; /* XXX */
+ /* Set the search filter for the properties editor. */
+ if ((region && region->regiontype == RGN_TYPE_WINDOW) &&
+ (area && area->spacetype == SPACE_PROPERTIES)) {
+ SpaceProperties *sbuts = CTX_wm_space_properties(C);
+ block->search_filter = sbuts->search_string;
+ }
+
if (scn) {
/* store display device name, don't lookup for transformations yet
* block could be used for non-color displays where looking up for transformation
diff --cc source/blender/editors/interface/interface_layout.c
index 37d45d6283b,888cacb64eb..c867a31f932
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@@ -987,24 -937,28 +987,30 @@@ static uiBut *ui_item_with_label(uiLayo
int h,
int flag)
{
- uiLayout *sub;
+ uiLayout *sub = layout;
uiBut *but = NULL;
+ uiBut *label_but = NULL;
PropertyType type;
PropertySubType subtype;
int prop_but_width = w_hint;
#ifdef UI_PROP_DECORATE
+ uiBut *decorator_but = NULL;
uiLayout *layout_prop_decorate = NULL;
const bool use_prop_sep = ((layout->item.flag & UI_ITEM_PROP_SEP) != 0);
+ const bool use_prop_decorate = use_prop_sep && (layout->item.flag & UI_ITEM_PROP_DECORATE) &&
+ (layout->item.flag & UI_ITEM_PROP_DECORATE_NO_PAD) == 0;
#endif
- /* Previously 'align' was enabled to make sure the label is spaced closely to the button.
- * Set the space to zero instead as aligning a large number of labels can end up aligning
- * thousands of buttons when displaying key-map search (a heavy operation), see: T78636. */
- sub = uiLayoutRow(layout, false);
- sub->space = 0;
- UI_block_layout_set_current(block, sub);
+ UI_block_layout_set_current(block, layout);
+
+ /* Only add new row if more than 1 item will be added. */
+ if (name[0] || use_prop_decorate) {
+ /* Also avoid setting 'align' if possible. Set the space to zero instead as aligning a large
+ * number of labels can end up aligning thousands of buttons when displaying key-map search (a
+ * heavy operation), see: T78636. */
+ sub = uiLayoutRow(layout, layout->align);
+ sub->space = 0;
+ }
#ifdef UI_PROP_DECORATE
if (name[0]) {
@@@ -1103,12 -1056,8 +1109,8 @@@
#ifdef UI_PROP_DECORATE
/* Only for alignment. */
- if (use_prop_sep) { /* Flag may have been unset meanwhile. */
- if ((layout->item.flag & UI_ITEM_PROP_DECORATE) &&
- (layout->item.flag & UI_ITEM_PROP_DECORATE_NO_PAD) == 0) {
- decorator_but = uiItemL_(
- layout_prop_decorate ? layout_prop_decorate : sub, NULL, ICON_BLANK1);
- }
+ if (use_prop_decorate) { /* Note that sep flag may have been unset meanwhile. */
- uiItemL(layout_prop_decorate ? layout_prop_decorate : sub, NULL, ICON_BLANK1);
++ decorator_but = uiItemL_(layout_prop_decorate ? layout_prop_decorate : sub, NULL, ICON_BLANK1);
}
#endif /* UI_PROP_DECORATE */
More information about the Bf-blender-cvs
mailing list