[Bf-blender-cvs] [087997f9ebc] blender2.8: Merge branch 'master' into blender2.8
Bastien Montagne
noreply at git.blender.org
Fri Dec 8 14:39:28 CET 2017
Commit: 087997f9ebcb90724120d736b885d5d7834f9e0f
Author: Bastien Montagne
Date: Fri Dec 8 14:39:17 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB087997f9ebcb90724120d736b885d5d7834f9e0f
Merge branch 'master' into blender2.8
Conflicts:
source/blender/editors/interface/interface_templates.c
===================================================================
===================================================================
diff --cc source/blender/editors/interface/interface_templates.c
index 7c58ac88a23,b5f88158e16..fae71f1fbc2
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@@ -483,12 -408,11 +483,12 @@@ static void template_ID
PointerRNA idptr;
// ListBase *lb; // UNUSED
ID *id, *idfrom;
- const bool editable = RNA_property_editable(&template->ptr, template->prop);
- const bool use_previews = template->preview = (flag & UI_ID_PREVIEWS) != 0;
+ const bool editable = RNA_property_editable(&template_ui->ptr, template_ui->prop);
++ const bool use_previews = template_ui->preview = (flag & UI_ID_PREVIEWS) != 0;
- idptr = RNA_property_pointer_get(&template->ptr, template->prop);
+ idptr = RNA_property_pointer_get(&template_ui->ptr, template_ui->prop);
id = idptr.data;
- idfrom = template->ptr.id.data;
+ idfrom = template_ui->ptr.id.data;
// lb = template->idlb;
block = uiLayoutGetBlock(layout);
@@@ -497,11 -421,29 +497,11 @@@
if (idptr.type)
type = idptr.type;
- if (flag & UI_ID_PREVIEWS) {
- template_ui->preview = true;
-
- but = uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template_ui), "", 0, 0, UI_UNIT_X * 6, UI_UNIT_Y * 6,
- TIP_(template_id_browse_tip(type)));
- ui_def_but_icon(but, id ? ui_id_icon_get(C, id, true) : RNA_struct_ui_icon(type),
- UI_HAS_ICON | UI_BUT_ICON_PREVIEW);
-
- if ((idfrom && idfrom->lib) || !editable)
- UI_but_flag_enable(but, UI_BUT_DISABLED);
-
- uiLayoutRow(layout, true);
- }
- else if (flag & UI_ID_BROWSE) {
- but = uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template_ui), "", 0, 0, UI_UNIT_X * 1.6, UI_UNIT_Y,
- TIP_(template_id_browse_tip(type)));
- ui_def_but_icon(but, RNA_struct_ui_icon(type), UI_HAS_ICON);
- /* default dragging of icon for id browse buttons */
- UI_but_drag_set_id(but, id);
- UI_but_drawflag_enable(but, UI_BUT_ICON_LEFT);
-
- if ((idfrom && idfrom->lib) || !editable)
- UI_but_flag_enable(but, UI_BUT_DISABLED);
+ if (flag & UI_ID_BROWSE) {
+ template_add_button_search_menu(
- C, layout, block, &template->ptr, template->prop,
- id_search_menu, MEM_dupallocN(template), TIP_(template_id_browse_tip(type)),
++ C, layout, block, &template_ui->ptr, template_ui->prop,
++ id_search_menu, MEM_dupallocN(template_ui), TIP_(template_id_browse_tip(type)),
+ use_previews, editable);
}
/* text button with name */
@@@ -511,10 -453,9 +511,10 @@@
//text_idbutton(id, name);
name[0] = '\0';
- but = uiDefButR(block, UI_BTYPE_TEXT, 0, name, 0, 0, UI_UNIT_X * 6, UI_UNIT_Y,
- &idptr, "name", -1, 0, 0, -1, -1, RNA_struct_ui_description(type));
+ but = uiDefButR(
+ block, UI_BTYPE_TEXT, 0, name, 0, 0, TEMPLATE_SEARCH_TEXTBUT_WIDTH, TEMPLATE_SEARCH_TEXTBUT_HEIGHT,
+ &idptr, "name", -1, 0, 0, -1, -1, RNA_struct_ui_description(type));
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_RENAME));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_RENAME));
if (user_alert) UI_but_flag_enable(but, UI_BUT_REDALERT);
if (id->lib) {
More information about the Bf-blender-cvs
mailing list