[Bf-blender-cvs] [6e85c592507] blender2.8: Merge branch 'master' into blender2.8

Bastien Montagne noreply at git.blender.org
Fri Dec 8 14:55:14 CET 2017


Commit: 6e85c5925078c1b9625714ca8bf80d54ba007ffc
Author: Bastien Montagne
Date:   Fri Dec 8 14:54:59 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB6e85c5925078c1b9625714ca8bf80d54ba007ffc

Merge branch 'master' into blender2.8

Conflicts:
	source/blender/editors/interface/interface_templates.c

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



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

diff --cc source/blender/editors/interface/interface_templates.c
index fae71f1fbc2,1aadeb26103..dc55f7a1f43
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@@ -295,16 -177,61 +295,16 @@@ static void id_search_cb(const bContex
  /* ID Search browse menu, open */
  static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem)
  {
- 	static TemplateID template;
 -	static char search[256];
+ 	static TemplateID template_ui;
 -	PointerRNA idptr;
 -	wmWindow *win = CTX_wm_window(C);
 -	uiBlock *block;
 -	uiBut *but;
 -	
 -	/* clear initial search string, then all items show */
 -	search[0] = 0;
 +	PointerRNA active_item_ptr;
 +
  	/* arg_litem is malloced, can be freed by parent button */
- 	template = *((TemplateID *)arg_litem);
- 	active_item_ptr = RNA_property_pointer_get(&template.ptr, template.prop);
+ 	template_ui = *((TemplateID *)arg_litem);
 -	
 -	/* get active id for showing first item */
 -	idptr = RNA_property_pointer_get(&template_ui.ptr, template_ui.prop);
++	active_item_ptr = RNA_property_pointer_get(&template_ui.ptr, template_ui.prop);
  
 -	block = UI_block_begin(C, ar, "_popup", UI_EMBOSS);
 -	UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_SEARCH_MENU);
 -	
 -	/* preview thumbnails */
 -	if (template_ui.prv_rows > 0 && template_ui.prv_cols > 0) {
 -		int w = 4 * U.widget_unit * template_ui.prv_cols;
 -		int h = 5 * U.widget_unit * template_ui.prv_rows;
 -		
 -		/* fake button, it holds space for search items */
 -		uiDefBut(block, UI_BTYPE_LABEL, 0, "", 10, 26, w, h, NULL, 0, 0, 0, 0, NULL);
 -		
 -		but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, w, UI_UNIT_Y,
 -		                     template_ui.prv_rows, template_ui.prv_cols, "");
 -		UI_but_func_search_set(
 -		        but, ui_searchbox_create_generic, id_search_cb,
 -		        &template_ui, id_search_call_cb, idptr.data);
 -	}
 -	/* list view */
 -	else {
 -		const int searchbox_width  = UI_searchbox_size_x();
 -		const int searchbox_height = UI_searchbox_size_y();
 -		
 -		/* fake button, it holds space for search items */
 -		uiDefBut(block, UI_BTYPE_LABEL, 0, "", 10, 15, searchbox_width, searchbox_height, NULL, 0, 0, 0, 0, NULL);
 -		but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, searchbox_width, UI_UNIT_Y - 1, 0, 0, "");
 -		UI_but_func_search_set(
 -		        but, ui_searchbox_create_generic, id_search_cb,
 -		        &template_ui, id_search_call_cb, idptr.data);
 -	}
 -		
 -	
 -	UI_block_bounds_set_normal(block, 0.3f * U.widget_unit);
 -	UI_block_direction_set(block, UI_DIR_DOWN);
 -	
 -	/* give search-field focus */
 -	UI_but_focus_on_enter_event(win, but);
 -	/* this type of search menu requires undo */
 -	but->flag |= UI_BUT_UNDO;
 -	
 -	return block;
 +	return template_common_search_menu(
- 	               C, ar, id_search_cb, &template, id_search_call_cb, active_item_ptr.data,
- 	               template.prv_rows, template.prv_cols);
++	               C, ar, id_search_cb, &template_ui, id_search_call_cb, active_item_ptr.data,
++	               template_ui.prv_rows, template_ui.prv_cols);
  }
  
  /************************ ID Template ***************************/
@@@ -408,8 -335,8 +408,8 @@@ static void template_id_cb(bContext *C
  				else {
  					if (id) {
  						Main *bmain = CTX_data_main(C);
- 						id_single_user(C, id, &template->ptr, template->prop);
+ 						id_single_user(C, id, &template_ui->ptr, template_ui->prop);
 -						DAG_relations_tag_update(bmain);
 +						DEG_relations_tag_update(bmain);
  					}
  				}
  			}



More information about the Bf-blender-cvs mailing list