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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-01-29 07:42:19 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-01-29 07:42:19 +0400
commitfe26492538edefe60a342bce109e17b9536e5a16 (patch)
treedf81d2485abd06be9cd2f4536a661b05153dff94 /source/blender/editors/interface/interface_templates.c
parent8f969fdc40cded16ec58f6810585411adbb5538d (diff)
parentcf9e619889fdcdc457e44d4b384cda091de55673 (diff)
Merged changes in the trunk up to revision 54171.
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r--source/blender/editors/interface/interface_templates.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index ec2b4f5adf0..58d59391939 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -58,6 +58,7 @@
#include "BKE_material.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
+#include "BKE_packedFile.h"
#include "BKE_particle.h"
#include "BKE_report.h"
#include "BKE_sca.h"
@@ -546,7 +547,18 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
uiButSetFlag(but, UI_BUT_DISABLED);
}
- if (flag & UI_ID_OPEN) {
+ /* Due to space limit in UI - skip the "open" icon for packed data, and allow to unpack.
+ Only for images, sound and fonts */
+ if (id && BKE_pack_check(id)) {
+
+ but = uiDefIconButO(block, BUT, "FILE_OT_unpack_item", WM_OP_INVOKE_REGION_WIN, ICON_PACKAGE, 0, 0, UI_UNIT_X, UI_UNIT_Y, "Packed File");
+ uiButGetOperatorPtrRNA(but);
+
+ RNA_string_set(but->opptr, "id_name", id->name + 2);
+ RNA_int_set(but->opptr, "id_type", GS(id->name));
+
+ }
+ else if (flag & UI_ID_OPEN) {
int w = id ? UI_UNIT_X : (flag & UI_ID_ADD_NEW) ? UI_UNIT_X * 3 : UI_UNIT_X * 6;
if (openop) {