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:
authorMiika Hamalainen <blender@miikah.org>2011-11-09 19:46:53 +0400
committerMiika Hamalainen <blender@miikah.org>2011-11-09 19:46:53 +0400
commit1b4a54ad73c058baa59ffdc9e5f18b0b79030fb0 (patch)
treea5b84d392ea14b0d760a5e24f7a8e51f203d558c /source/blender/editors/interface/interface_templates.c
parentedec46b0a6aac18f406991b9e16228d4bd848c61 (diff)
parentbc5ec4e69cf3308c2563239c0e8372b853800a78 (diff)
Merge with trunk r41701soc-2011-carrot
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r--source/blender/editors/interface/interface_templates.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 6a3e6025653..263d689cf62 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -41,6 +41,8 @@
#include "BLI_string.h"
#include "BLI_ghash.h"
+#include "BLF_translation.h"
+
#include "BKE_animsys.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
@@ -334,7 +336,7 @@ static const char *template_id_browse_tip(StructRNA *type)
return N_("Browse ID data to be linked");
}
-static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, StructRNA *type, int flag, const char *newop, const char *openop, const char *unlinkop)
+static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, StructRNA *type, short idcode, int flag, const char *newop, const char *openop, const char *unlinkop)
{
uiBut *but;
uiBlock *block;
@@ -480,6 +482,9 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
if((idfrom && idfrom->lib) || !editable)
uiButSetFlag(but, UI_BUT_DISABLED);
}
+
+ if(idcode == ID_TE)
+ uiTemplateTextureShow(layout, C, &template->ptr, template->prop);
uiBlockEndAlign(block);
}
@@ -489,6 +494,7 @@ static void ui_template_id(uiLayout *layout, bContext *C, PointerRNA *ptr, const
TemplateID *template;
PropertyRNA *prop;
StructRNA *type;
+ short idcode;
prop= RNA_struct_find_property(ptr, propname);
@@ -509,14 +515,15 @@ static void ui_template_id(uiLayout *layout, bContext *C, PointerRNA *ptr, const
flag |= UI_ID_OPEN;
type= RNA_property_pointer_type(ptr, prop);
- template->idlb= which_libbase(CTX_data_main(C), RNA_type_to_ID_code(type));
+ idcode= RNA_type_to_ID_code(type);
+ template->idlb= which_libbase(CTX_data_main(C), idcode);
/* create UI elements for this template
* - template_ID makes a copy of the template data and assigns it to the relevant buttons
*/
if(template->idlb) {
uiLayoutRow(layout, 1);
- template_ID(C, layout, template, type, flag, newop, openop, unlinkop);
+ template_ID(C, layout, template, type, idcode, flag, newop, openop, unlinkop);
}
MEM_freeN(template);