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:
authorJoseph Eagar <joeedh@gmail.com>2009-09-16 21:43:09 +0400
committerJoseph Eagar <joeedh@gmail.com>2009-09-16 21:43:09 +0400
commitdeebf4f8f0d79169a0e6c2a391670419b6492bfe (patch)
tree2a0aaf4042aa78e9d1d835f4544e07c6123e67a9 /source/blender/editors/interface
parent6b0679a3999d8e5abc60730f523879eadbedcd8f (diff)
merge with 2.5/trunk at r23271
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface.c3
-rw-r--r--source/blender/editors/interface/interface_anim.c28
-rw-r--r--source/blender/editors/interface/interface_handlers.c60
-rw-r--r--source/blender/editors/interface/interface_icons.c1
-rw-r--r--source/blender/editors/interface/interface_intern.h2
-rw-r--r--source/blender/editors/interface/interface_layout.c95
-rw-r--r--source/blender/editors/interface/interface_panel.c1
-rw-r--r--source/blender/editors/interface/interface_regions.c2
-rw-r--r--source/blender/editors/interface/interface_templates.c122
-rw-r--r--source/blender/editors/interface/interface_utils.c66
-rw-r--r--source/blender/editors/interface/interface_widgets.c69
-rw-r--r--source/blender/editors/interface/resources.c12
-rw-r--r--source/blender/editors/interface/view2d_ops.c13
13 files changed, 382 insertions, 92 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 3c6e12905d6..221618b340e 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -2264,6 +2264,9 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short
}
}
+ if(!ELEM7(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX, LISTBOX, SEARCH_MENU))
+ but->flag |= UI_BUT_UNDO;
+
BLI_addtail(&block->buttons, but);
if(block->curlayout)
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index 784d820ea52..8c41726b81b 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -152,6 +152,8 @@ void ui_but_anim_autokey(uiBut *but, Scene *scene, float cfra)
flag |= INSERTKEY_NEEDED;
if (IS_AUTOKEY_FLAG(AUTOMATKEY))
flag |= INSERTKEY_MATRIX;
+ if (IS_AUTOKEY_MODE(scene, EDITKEYS))
+ flag |= INSERTKEY_REPLACE;
fcu->flag &= ~FCURVE_SELECTED;
insert_keyframe(id, action, ((fcu->grp)?(fcu->grp->name):(NULL)), fcu->rna_path, fcu->array_index, cfra, flag);
@@ -207,6 +209,18 @@ void ui_but_anim_remove_driver(bContext *C)
WM_operator_name_call(C, "ANIM_OT_remove_driver_button", WM_OP_INVOKE_DEFAULT, NULL);
}
+void ui_but_anim_add_keyingset(bContext *C)
+{
+ /* this operator calls uiAnimContextProperty above */
+ WM_operator_name_call(C, "ANIM_OT_add_keyingset_button", WM_OP_INVOKE_DEFAULT, NULL);
+}
+
+void ui_but_anim_remove_keyingset(bContext *C)
+{
+ /* this operator calls uiAnimContextProperty above */
+ WM_operator_name_call(C, "ANIM_OT_remove_keyingset_button", WM_OP_INVOKE_DEFAULT, NULL);
+}
+
void ui_but_anim_menu(bContext *C, uiBut *but)
{
uiPopupMenu *pup;
@@ -262,6 +276,20 @@ void ui_but_anim_menu(bContext *C, uiBut *but)
else
uiItemBooleanO(layout, "Add Driver", 0, "ANIM_OT_add_driver_button", "all", 0);
}
+
+ if(RNA_property_animateable(&but->rnapoin, but->rnaprop)) {
+ uiItemS(layout);
+
+ if(length) {
+ uiItemBooleanO(layout, "Add All to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 1);
+ uiItemBooleanO(layout, "Add Single to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 0);
+ uiItemO(layout, "Remove from Keying Set", 0, "ANIM_OT_remove_keyingset_button");
+ }
+ else {
+ uiItemBooleanO(layout, "Add to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 0);
+ uiItemO(layout, "Remove from Keying Set", 0, "ANIM_OT_remove_keyingset_button");
+ }
+ }
uiPupMenuEnd(C, pup);
}
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index b69e8319956..152695c9162 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -292,8 +292,7 @@ static void ui_apply_autokey_undo(bContext *C, uiBut *but)
uiAfterFunc *after;
char *str= NULL;
- if ELEM6(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX, LISTBOX);
- else {
+ if(but->flag & UI_BUT_UNDO) {
/* define which string to use for undo */
if ELEM(but->type, LINK, INLINK) str= "Add button link";
else if ELEM(but->type, MENU, ICONTEXTROW) str= but->drawstr;
@@ -678,7 +677,11 @@ static void ui_add_link(uiBut *from, uiBut *to)
return;
}
- if (from->type==LINK && to->type==INLINK) {
+ if (from->type==INLINK && to->type==INLINK) {
+ printf("cannot link\n");
+ return;
+ }
+ else if (from->type==LINK && to->type==INLINK) {
if( from->link->tocode != (int)to->hardmin ) {
printf("cannot link\n");
return;
@@ -1436,16 +1439,20 @@ static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
for(but= actbut->next; but; but= but->next) {
if(ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU)) {
- data->postbut= but;
- data->posttype= BUTTON_ACTIVATE_TEXT_EDITING;
- return;
+ if(!(but->flag & UI_BUT_DISABLED)) {
+ data->postbut= but;
+ data->posttype= BUTTON_ACTIVATE_TEXT_EDITING;
+ return;
+ }
}
}
for(but= block->buttons.first; but!=actbut; but= but->next) {
if(ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU)) {
- data->postbut= but;
- data->posttype= BUTTON_ACTIVATE_TEXT_EDITING;
- return;
+ if(!(but->flag & UI_BUT_DISABLED)) {
+ data->postbut= but;
+ data->posttype= BUTTON_ACTIVATE_TEXT_EDITING;
+ return;
+ }
}
}
}
@@ -1460,16 +1467,20 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
for(but= actbut->prev; but; but= but->prev) {
if(ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU)) {
- data->postbut= but;
- data->posttype= BUTTON_ACTIVATE_TEXT_EDITING;
- return;
+ if(!(but->flag & UI_BUT_DISABLED)) {
+ data->postbut= but;
+ data->posttype= BUTTON_ACTIVATE_TEXT_EDITING;
+ return;
+ }
}
}
for(but= block->buttons.last; but!=actbut; but= but->prev) {
if(ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU)) {
- data->postbut= but;
- data->posttype= BUTTON_ACTIVATE_TEXT_EDITING;
- return;
+ if(!(but->flag & UI_BUT_DISABLED)) {
+ data->postbut= but;
+ data->posttype= BUTTON_ACTIVATE_TEXT_EDITING;
+ return;
+ }
}
}
}
@@ -3261,18 +3272,18 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
ui_but_copy_paste(C, but, data, (event->type == CKEY)? 'c': 'v');
return WM_UI_HANDLER_BREAK;
}
- /* handle keyframeing */
+ /* handle keyframing */
else if(event->type == IKEY && event->val == KM_PRESS) {
if(event->alt)
ui_but_anim_delete_keyframe(C);
else
ui_but_anim_insert_keyframe(C);
-
+
ED_region_tag_redraw(CTX_wm_region(C));
-
+
return WM_UI_HANDLER_BREAK;
}
- /* handle driver adding */
+ /* handle drivers */
else if(event->type == DKEY && event->val == KM_PRESS) {
if(event->alt)
ui_but_anim_remove_driver(C);
@@ -3283,6 +3294,17 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
return WM_UI_HANDLER_BREAK;
}
+ /* handle keyingsets */
+ else if(event->type == KKEY && event->val == KM_PRESS) {
+ if(event->alt)
+ ui_but_anim_remove_keyingset(C);
+ else
+ ui_but_anim_remove_keyingset(C);
+
+ ED_region_tag_redraw(CTX_wm_region(C));
+
+ return WM_UI_HANDLER_BREAK;
+ }
/* handle menu */
else if(event->type == RIGHTMOUSE && event->val == KM_PRESS) {
/* RMB has two options now */
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 549164c23a1..6c4110c8c37 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -34,6 +34,7 @@
#else
#include <io.h>
#include <direct.h>
+#include "BLI_winstuff.h"
#endif
#include "MEM_guardedalloc.h"
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 806b40b8646..2e623114fe9 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -467,6 +467,8 @@ void ui_but_anim_insert_keyframe(struct bContext *C);
void ui_but_anim_delete_keyframe(struct bContext *C);
void ui_but_anim_add_driver(struct bContext *C);
void ui_but_anim_remove_driver(struct bContext *C);
+void ui_but_anim_add_keyingset(struct bContext *C);
+void ui_but_anim_remove_keyingset(struct bContext *C);
void ui_but_anim_menu(struct bContext *C, uiBut *but);
int ui_but_anim_expression_get(uiBut *but, char *str, int maxlen);
int ui_but_anim_expression_set(uiBut *but, const char *str);
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index a52afcb1a92..b6afc4daa9b 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -310,6 +310,30 @@ static uiLayout *ui_item_local_sublayout(uiLayout *test, uiLayout *layout, int a
return sub;
}
+static void ui_layer_but_cb(bContext *C, void *arg_but, void *arg_index)
+{
+ wmWindow *win= CTX_wm_window(C);
+ uiBut *but= arg_but, *cbut;
+ PointerRNA *ptr= &but->rnapoin;
+ PropertyRNA *prop= but->rnaprop;
+ int i, index= GET_INT_FROM_POINTER(arg_index);
+ int shift= win->eventstate->shift;
+ int len= RNA_property_array_length(ptr, prop);
+
+ if(!shift) {
+ RNA_property_boolean_set_index(ptr, prop, index, 1);
+
+ for(i=0; i<len; i++)
+ if(i != index)
+ RNA_property_boolean_set_index(ptr, prop, i, 0);
+
+ RNA_property_update(C, ptr, prop);
+
+ for(cbut=but->block->buttons.first; cbut; cbut=cbut->next)
+ ui_check_but(cbut);
+ }
+}
+
/* create buttons for an item with an RNA array */
static void ui_item_array(uiLayout *layout, uiBlock *block, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int len, int x, int y, int w, int h, int expand, int slider)
{
@@ -318,7 +342,7 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, char *name, int icon
PropertyType type;
PropertySubType subtype;
uiLayout *sub;
- int a;
+ int a, b;
/* retrieve type and subtype */
type= RNA_property_type(prop);
@@ -332,9 +356,11 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, char *name, int icon
uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
/* create buttons */
- if(type == PROP_BOOLEAN && len == 20) {
+ if(type == PROP_BOOLEAN && ELEM(subtype, PROP_LAYER, PROP_LAYER_MEMBER)) {
/* special check for layer layout */
int butw, buth, unit;
+ int cols= (len >= 20)? 2: 1;
+ int colbuts= len/(2*cols);
uiBlockSetCurLayout(block, uiLayoutFree(layout, 0));
@@ -342,21 +368,23 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, char *name, int icon
butw= unit;
buth= unit;
- uiBlockBeginAlign(block);
- for(a=0; a<5; a++)
- uiDefAutoButR(block, ptr, prop, a, "", ICON_BLANK1, x + butw*a, y+buth, butw, buth);
- for(a=0; a<5; a++)
- uiDefAutoButR(block, ptr, prop, a+10, "", ICON_BLANK1, x + butw*a, y, butw, buth);
- uiBlockEndAlign(block);
+ for(b=0; b<cols; b++) {
+ uiBlockBeginAlign(block);
- x += 5*butw + style->buttonspacex;
+ for(a=0; a<colbuts; a++) {
+ but= uiDefAutoButR(block, ptr, prop, a+b*colbuts, "", ICON_BLANK1, x + butw*a, y+buth, butw, buth);
+ if(subtype == PROP_LAYER_MEMBER)
+ uiButSetFunc(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(a+b*colbuts));
+ }
+ for(a=0; a<colbuts; a++) {
+ but= uiDefAutoButR(block, ptr, prop, a+len/2+b*colbuts, "", ICON_BLANK1, x + butw*a, y, butw, buth);
+ if(subtype == PROP_LAYER_MEMBER)
+ uiButSetFunc(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(a+len/2+b*colbuts));
+ }
+ uiBlockEndAlign(block);
- uiBlockBeginAlign(block);
- for(a=0; a<5; a++)
- uiDefAutoButR(block, ptr, prop, a+5, "", ICON_BLANK1, x + butw*a, y+buth, butw, buth);
- for(a=0; a<5; a++)
- uiDefAutoButR(block, ptr, prop, a+15, "", ICON_BLANK1, x + butw*a, y, butw, buth);
- uiBlockEndAlign(block);
+ x += colbuts*butw + style->buttonspacex;
+ }
}
else if(subtype == PROP_MATRIX) {
/* matrix layout */
@@ -415,7 +443,7 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, char *name, int icon
uiBlockSetCurLayout(block, layout);
}
-static void ui_item_enum_row(uiLayout *layout, uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, char *uiname, int x, int y, int w, int h)
+static void ui_item_enum_row(uiLayout *layout, uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, char *uiname, int x, int y, int w, int h, int icon_only)
{
EnumPropertyItem *item;
const char *identifier;
@@ -435,7 +463,7 @@ static void ui_item_enum_row(uiLayout *layout, uiBlock *block, PointerRNA *ptr,
value= item[a].value;
itemw= ui_text_icon_width(block->curlayout, name, icon, 0);
- if(icon && strcmp(name, "") != 0)
+ if(icon && strcmp(name, "") != 0 && !icon_only)
uiDefIconTextButR(block, ROW, 0, icon, name, 0, 0, itemw, h, ptr, identifier, -1, 0, value, -1, -1, NULL);
else if(icon)
uiDefIconButR(block, ROW, 0, icon, 0, 0, itemw, h, ptr, identifier, -1, 0, value, -1, -1, NULL);
@@ -449,7 +477,7 @@ static void ui_item_enum_row(uiLayout *layout, uiBlock *block, PointerRNA *ptr,
}
/* create label + button for RNA property */
-static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int x, int y, int w, int h)
+static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int x, int y, int w, int h, int icon_only)
{
uiLayout *sub;
uiBut *but;
@@ -478,7 +506,7 @@ static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, char *name, i
but= uiDefIconButO(block, BUT, "BUTTONS_OT_file_browse", WM_OP_INVOKE_DEFAULT, ICON_FILESEL, x, y, UI_UNIT_X, h, "Browse for file or directory.");
}
else
- but= uiDefAutoButR(block, ptr, prop, index, "", icon, x, y, w, h);
+ but= uiDefAutoButR(block, ptr, prop, index, (!icon_only)? "": NULL, icon, x, y, w, h);
uiBlockSetCurLayout(block, layout);
return but;
@@ -690,7 +718,7 @@ void uiItemEnumO_string(uiLayout *layout, char *name, int icon, char *opname, ch
/* enum lookup */
if((prop= RNA_struct_find_property(&ptr, propname))) {
RNA_property_enum_items(layout->root->block->evil_C, &ptr, prop, &item, NULL, &free);
- if(RNA_enum_value_from_id(item, value_str, &value)==0) {
+ if(item==NULL || RNA_enum_value_from_id(item, value_str, &value)==0) {
if(free) MEM_freeN(item);
printf("uiItemEnumO_string: %s.%s, enum %s not found.\n", RNA_struct_identifier(ptr.type), propname, value_str);
return;
@@ -760,7 +788,7 @@ void uiItemO(uiLayout *layout, char *name, int icon, char *opname)
/* RNA property items */
-static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int *r_w, int *r_h)
+static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int icon_only, int *r_w, int *r_h)
{
PropertyType type;
PropertySubType subtype;
@@ -771,9 +799,9 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PointerRNA
subtype= RNA_property_subtype(prop);
len= RNA_property_array_length(ptr, prop);
- if(ELEM3(type, PROP_STRING, PROP_POINTER, PROP_ENUM) && !name[0])
+ if(ELEM3(type, PROP_STRING, PROP_POINTER, PROP_ENUM) && !name[0] && !icon_only)
name= "non-empty text";
- else if(type == PROP_BOOLEAN && !name[0])
+ else if(type == PROP_BOOLEAN && !name[0] && !icon_only)
icon= ICON_DOT;
w= ui_text_icon_width(layout, name, icon, 0);
@@ -784,7 +812,7 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PointerRNA
if(!name[0] && icon == 0)
h= 0;
- if(type == PROP_BOOLEAN && len == 20)
+ if(ELEM(subtype, PROP_LAYER, PROP_LAYER_MEMBER))
h += 2*UI_UNIT_Y;
else if(subtype == PROP_MATRIX)
h += ceil(sqrt(len))*UI_UNIT_Y;
@@ -795,7 +823,7 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PointerRNA
if(type == PROP_BOOLEAN && strcmp(name, "") != 0)
w += UI_UNIT_X/5;
else if(type == PROP_ENUM)
- w += UI_UNIT_X/2;
+ w += UI_UNIT_X/4;
else if(type == PROP_FLOAT || type == PROP_INT)
w += UI_UNIT_X*3;
}
@@ -810,7 +838,7 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper
uiBut *but;
PropertyType type;
char namestr[UI_MAX_NAME_STR];
- int len, w, h, slider, toggle, expand;
+ int len, w, h, slider, toggle, expand, icon_only;
if(!ptr->data || !prop)
return;
@@ -844,9 +872,10 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper
slider= (flag & UI_ITEM_R_SLIDER);
toggle= (flag & UI_ITEM_R_TOGGLE);
expand= (flag & UI_ITEM_R_EXPAND);
+ icon_only= (flag & UI_ITEM_R_ICON_ONLY);
/* get size */
- ui_item_rna_size(layout, name, icon, ptr, prop, index, &w, &h);
+ ui_item_rna_size(layout, name, icon, ptr, prop, index, icon_only, &w, &h);
/* array property */
if(index == RNA_NO_INDEX && len > 0)
@@ -855,7 +884,7 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper
else if(type == PROP_ENUM && index == RNA_ENUM_VALUE) {
char *identifier= (char*)RNA_property_identifier(prop);
- if(icon && strcmp(name, "") != 0)
+ if(icon && strcmp(name, "") != 0 && !icon_only)
uiDefIconTextButR(block, ROW, 0, icon, name, 0, 0, w, h, ptr, identifier, -1, 0, value, -1, -1, NULL);
else if(icon)
uiDefIconButR(block, ROW, 0, icon, 0, 0, w, h, ptr, identifier, -1, 0, value, -1, -1, NULL);
@@ -864,10 +893,10 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper
}
/* expanded enum */
else if(type == PROP_ENUM && expand)
- ui_item_enum_row(layout, block, ptr, prop, name, 0, 0, w, h);
+ ui_item_enum_row(layout, block, ptr, prop, name, 0, 0, w, h, icon_only);
/* property with separate label */
else if(type == PROP_ENUM || type == PROP_STRING || type == PROP_POINTER) {
- but= ui_item_with_label(layout, block, name, icon, ptr, prop, index, 0, 0, w, h);
+ but= ui_item_with_label(layout, block, name, icon, ptr, prop, index, 0, 0, w, h, icon_only);
ui_but_add_search(but, ptr, prop, NULL, NULL);
}
/* single button */
@@ -1078,7 +1107,7 @@ void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRN
but->hardmax= MAX2(but->hardmax, 256);
but->rnasearchpoin= *searchptr;
but->rnasearchprop= searchprop;
- but->flag |= UI_ICON_LEFT|UI_TEXT_LEFT;
+ but->flag |= UI_ICON_LEFT|UI_TEXT_LEFT|UI_BUT_UNDO;
uiButSetSearchFunc(but, rna_search_cb, but, NULL, NULL);
}
@@ -1132,8 +1161,8 @@ void uiItemPointerR(uiLayout *layout, char *name, int icon, struct PointerRNA *p
/* create button */
block= uiLayoutGetBlock(layout);
- ui_item_rna_size(layout, name, icon, ptr, prop, 0, &w, &h);
- but= ui_item_with_label(layout, block, name, icon, ptr, prop, 0, 0, 0, w, h);
+ ui_item_rna_size(layout, name, icon, ptr, prop, 0, 0, &w, &h);
+ but= ui_item_with_label(layout, block, name, icon, ptr, prop, 0, 0, 0, w, h, 0);
ui_but_add_search(but, ptr, prop, searchptr, searchprop);
}
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 05001109b53..776122380bf 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -990,6 +990,7 @@ static void test_add_new_tabs(ARegion *ar)
}
if(pasel==NULL || palap==NULL) return;
+ if(palap->type && palap->type->flag & PNL_NO_HEADER) return;
/* the overlapped panel becomes a tab */
palap->paneltab= pasel;
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 1d911fef418..dfcdea59f68 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -758,7 +758,7 @@ void ui_searchbox_update(bContext *C, ARegion *ar, uiBut *but, int reset)
data->active= a+1;
if(cpoin) cpoin[0]= '|';
}
- if(data->items.totitem==1)
+ if(data->items.totitem==1 && but->editstr[0])
data->active= 1;
}
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 6aa5f5efc41..2b7d6f383bf 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -157,7 +157,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
{
TemplateID *template= (TemplateID*)arg_litem;
PointerRNA idptr= RNA_property_pointer_get(&template->ptr, template->prop);
- ID *id= idptr.data;
+ ID *id= idptr.data, *newid;
int event= GET_INT_FROM_POINTER(arg_event);
switch(event) {
@@ -185,28 +185,48 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
}
else return;
break;
-#if 0
- case UI_ID_ALONE:
- if(!id || id->us < 1)
- return;
- break;
case UI_ID_LOCAL:
- if(!id || id->us < 1)
- return;
+ if(id) {
+ if(id_make_local(id, 0)) {
+ /* reassign to get get proper updates/notifiers */
+ idptr= RNA_property_pointer_get(&template->ptr, template->prop);
+ RNA_property_pointer_set(&template->ptr, template->prop, idptr);
+ RNA_property_update(C, &template->ptr, template->prop);
+ }
+ }
+ break;
+ case UI_ID_ALONE:
+ if(id) {
+ /* make copy */
+ if(id_copy(id, &newid, 0) && newid) {
+ /* us is 1 by convention, but RNA_property_pointer_set
+ will also incremement it, so set it to zero */
+ newid->us= 0;
+
+ /* assign copy */
+ RNA_id_pointer_create(newid, &idptr);
+ RNA_property_pointer_set(&template->ptr, template->prop, idptr);
+ RNA_property_update(C, &template->ptr, template->prop);
+ }
+ }
break;
+#if 0
case UI_ID_AUTO_NAME:
break;
#endif
}
}
-static void template_ID(bContext *C, uiBlock *block, TemplateID *template, StructRNA *type, int flag, char *newop, char *unlinkop)
+static void template_ID(bContext *C, uiBlock *block, TemplateID *template, StructRNA *type, int flag, char *newop, char *openop, char *unlinkop)
{
uiBut *but;
PointerRNA idptr;
ListBase *lb;
+ ID *id, *idfrom;
idptr= RNA_property_pointer_get(&template->ptr, template->prop);
+ id= idptr.data;
+ idfrom= template->ptr.id.data;
lb= template->idlb;
uiBlockBeginAlign(block);
@@ -221,33 +241,86 @@ static void template_ID(bContext *C, uiBlock *block, TemplateID *template, Struc
but->flag|= UI_HAS_ICON;
but->flag|= UI_ICON_LEFT;
}
+
+ if((idfrom && idfrom->lib))
+ uiButSetFlag(but, UI_BUT_DISABLED);
}
/* text button with name */
- if(idptr.data) {
+ if(id) {
char name[64];
- //text_idbutton(idptr.data, name);
+ //text_idbutton(id, name);
name[0]= '\0';
but= uiDefButR(block, TEX, 0, name, 0, 0, UI_UNIT_X*6, UI_UNIT_Y, &idptr, "name", -1, 0, 0, -1, -1, NULL);
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_RENAME));
+
+ if(id->lib) {
+ if(id->flag & LIB_INDIRECT) {
+ but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_INDIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, 0, 0, 0, 0, 0,
+ "Indirect library datablock, cannot change.");
+ uiButSetFlag(but, UI_BUT_DISABLED);
+ }
+ else {
+ but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_DIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, 0, 0, 0, 0, 0,
+ "Direct linked library datablock, click to make local.");
+ if(!id_make_local(id, 1 /* test */) || (idfrom && idfrom->lib))
+ uiButSetFlag(but, UI_BUT_DISABLED);
+ }
+
+ uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_LOCAL));
+ }
+
+ if(id->us > 1) {
+ char str[32];
+
+ sprintf(str, "%d", id->us);
+
+ if(id->us<10)
+ but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X,UI_UNIT_Y, 0, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy.");
+ else
+ but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X+10,UI_UNIT_Y, 0, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy.");
+
+ uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE));
+ if(!id_copy(id, NULL, 1 /* test only */) || (idfrom && idfrom->lib))
+ uiButSetFlag(but, UI_BUT_DISABLED);
+ }
}
if(flag & UI_ID_ADD_NEW) {
- int w= idptr.data?UI_UNIT_X:UI_UNIT_X*6;
+ int w= id?UI_UNIT_X: (flag & UI_ID_OPEN)? UI_UNIT_X*3: UI_UNIT_X*6;
if(newop) {
- but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_REGION_WIN, ICON_ZOOMIN, (idptr.data)? "": "Add New", 0, 0, w, UI_UNIT_Y, NULL);
+ but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_REGION_WIN, ICON_ZOOMIN, (id)? "": "New", 0, 0, w, UI_UNIT_Y, NULL);
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
}
else {
- but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (idptr.data)? "": "Add New", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
+ but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (id)? "": "New", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
}
+
+ if((idfrom && idfrom->lib))
+ uiButSetFlag(but, UI_BUT_DISABLED);
+ }
+
+ 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) {
+ but= uiDefIconTextButO(block, BUT, openop, WM_OP_INVOKE_REGION_WIN, ICON_FILESEL, (id)? "": "Open", 0, 0, w, UI_UNIT_Y, NULL);
+ uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN));
+ }
+ else {
+ but= uiDefIconTextBut(block, BUT, 0, ICON_FILESEL, (id)? "": "Open", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
+ uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN));
+ }
+
+ if((idfrom && idfrom->lib))
+ uiButSetFlag(but, UI_BUT_DISABLED);
}
/* delete button */
- if(idptr.data && (flag & UI_ID_DELETE)) {
+ if(id && (flag & UI_ID_DELETE)) {
if(unlinkop) {
but= uiDefIconButO(block, BUT, unlinkop, WM_OP_INVOKE_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL);
}
@@ -255,12 +328,15 @@ static void template_ID(bContext *C, uiBlock *block, TemplateID *template, Struc
but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_DELETE));
}
+
+ if((idfrom && idfrom->lib))
+ uiButSetFlag(but, UI_BUT_DISABLED);
}
uiBlockEndAlign(block);
}
-void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, char *newop, char *unlinkop)
+void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, char *newop, char *openop, char *unlinkop)
{
TemplateID *template;
uiBlock *block;
@@ -286,6 +362,8 @@ void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname
if(newop)
flag |= UI_ID_ADD_NEW;
+ if(openop)
+ flag |= UI_ID_OPEN;
type= RNA_property_pointer_type(ptr, prop);
template->idlb= wich_libbase(CTX_data_main(C), RNA_type_to_ID_code(type));
@@ -293,7 +371,7 @@ void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname
if(template->idlb) {
uiLayoutRow(layout, 1);
block= uiLayoutGetBlock(layout);
- template_ID(C, block, template, type, flag, newop, unlinkop);
+ template_ID(C, block, template, type, flag, newop, openop, unlinkop);
}
MEM_freeN(template);
@@ -328,7 +406,6 @@ void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname
static void modifiers_setOnCage(bContext *C, void *ob_v, void *md_v)
{
- Scene *scene= CTX_data_scene(C);
Object *ob = ob_v;
ModifierData *md;
@@ -343,12 +420,11 @@ static void modifiers_setOnCage(bContext *C, void *ob_v, void *md_v)
}
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
- DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
}
static void modifiers_convertToReal(bContext *C, void *ob_v, void *md_v)
{
- Scene *scene= CTX_data_scene(C);
Object *ob = ob_v;
ModifierData *md = md_v;
ModifierData *nmd = modifier_new(md->type);
@@ -361,7 +437,7 @@ static void modifiers_convertToReal(bContext *C, void *ob_v, void *md_v)
ob->partype = PAROBJECT;
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
- DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
ED_undo_push(C, "Modifier convert to real");
}
@@ -597,8 +673,8 @@ void do_constraint_panels(bContext *C, void *arg, int event)
if(ob->pose) update_pose_constraint_flags(ob->pose);
- if(ob->type==OB_ARMATURE) DAG_object_flush_update(scene, ob, OB_RECALC_DATA|OB_RECALC_OB);
- else DAG_object_flush_update(scene, ob, OB_RECALC_OB);
+ if(ob->type==OB_ARMATURE) DAG_id_flush_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB);
+ else DAG_id_flush_update(&ob->id, OB_RECALC_OB);
// XXX allqueue(REDRAWVIEW3D, 0);
// XXX allqueue(REDRAWBUTSOBJECT, 0);
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index 5b44f6544d1..539c71cc497 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -33,6 +33,7 @@
#include "DNA_color_types.h"
#include "DNA_listBase.h"
#include "DNA_material_types.h"
+#include "DNA_lamp_types.h""
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "DNA_texture_types.h"
@@ -108,7 +109,12 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
but= uiDefButR(block, NUM, 0, name, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL);
break;
case PROP_ENUM:
- but= uiDefButR(block, MENU, 0, NULL, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL);
+ if(icon && name && strcmp(name, "") == 0)
+ but= uiDefIconButR(block, MENU, 0, icon, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL);
+ else if(icon)
+ but= uiDefIconTextButR(block, MENU, 0, icon, NULL, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL);
+ else
+ but= uiDefButR(block, MENU, 0, NULL, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL);
break;
case PROP_STRING:
if(icon && name && strcmp(name, "") == 0)
@@ -504,6 +510,64 @@ int uiDefIDPoinButs(uiBlock *block, Main *bmain, ID *parid, ID *id, int id_code,
return x;
}
+/* currently only object-data types */
+int uiIconFromID(ID *id)
+{
+ if (id==NULL)
+ return 0;
+
+ switch(GS(id->name)) {
+ case ID_OB:
+ {
+ Object *ob= (Object *)id;
+
+ switch(ob->type) {
+ case OB_EMPTY:
+ return ICON_EMPTY_DATA;
+ case OB_CURVE:
+ return ICON_CURVE_DATA;
+ case OB_SURF:
+ return ICON_SURFACE_DATA;
+ case OB_FONT:
+ return ICON_FONT_DATA;
+ }
+
+ return uiIconFromID(ob->data);
+ }
+ case ID_ME:
+ return ICON_MESH_DATA;
+ case ID_AR:
+ return ICON_ARMATURE_DATA;
+ case ID_MB:
+ return ICON_META_DATA;
+ case ID_CA:
+ return ICON_CAMERA_DATA;
+ case ID_LT:
+ return ICON_LATTICE_DATA;
+ case ID_CU:
+ return ICON_CURVE_DATA;
+ case ID_LA:
+ {
+ Lamp *la= (Lamp *)id;
+ switch(la->type) {
+ case LA_LOCAL:
+ return ICON_LAMP_POINT;
+ case LA_SUN:
+ return ICON_LAMP_SUN;
+ case LA_SPOT:
+ return ICON_LAMP_SPOT;
+ case LA_HEMI:
+ return ICON_LAMP_HEMI;
+ case LA_AREA:
+ return ICON_LAMP_AREA;
+ }
+ return ICON_LAMP_DATA;
+ }
+ }
+
+ return 0;
+}
+
/* ****************************** default button callbacks ******************* */
/* ************ LEGACY WARNING, only to get things work with 2.48 code! ****** */
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index f0085f71373..90b2c920613 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -129,17 +129,21 @@ static float jit[8][2]= {{0.468813 , -0.481430}, {-0.155755 , -0.352820},
{0.219306 , -0.238501}, {-0.393286 , -0.110949}, {-0.024699 , 0.013908},
{0.343805 , 0.147431}, {-0.272855 , 0.269918}, {0.095909 , 0.388710}};
-static float num_tria_vert[19][2]= {
+static float num_tria_vert[3][2]= {
+{-0.352077, 0.532607}, {-0.352077, -0.549313}, {0.330000, -0.008353}};
+
+static int num_tria_face[1][3]= {
+{0, 1, 2}};
+
+static float scroll_circle_vert[16][2]= {
{0.382684, 0.923879}, {0.000001, 1.000000}, {-0.382683, 0.923880}, {-0.707107, 0.707107},
{-0.923879, 0.382684}, {-1.000000, 0.000000}, {-0.923880, -0.382684}, {-0.707107, -0.707107},
{-0.382683, -0.923880}, {0.000000, -1.000000}, {0.382684, -0.923880}, {0.707107, -0.707107},
-{0.923880, -0.382684}, {1.000000, -0.000000}, {0.923880, 0.382683}, {0.707107, 0.707107},
-{-0.352077, 0.532607}, {-0.352077, -0.549313}, {0.729843, -0.008353}};
+{0.923880, -0.382684}, {1.000000, -0.000000}, {0.923880, 0.382683}, {0.707107, 0.707107}};
-static int num_tria_face[19][3]= {
-{13, 14, 18}, {17, 5, 6}, {12, 13, 18}, {17, 6, 7}, {15, 18, 14}, {16, 4, 5}, {16, 5, 17}, {18, 11, 12},
-{18, 17, 10}, {18, 10, 11}, {17, 9, 10}, {15, 0, 18}, {18, 0, 16}, {3, 4, 16}, {8, 9, 17}, {8, 17, 7},
-{2, 3, 16}, {1, 2, 16}, {16, 0, 1}};
+static int scroll_circle_face[14][3]= {
+{0, 1, 2}, {2, 0, 3}, {3, 0, 15}, {3, 15, 4}, {4, 15, 14}, {4, 14, 5}, {5, 14, 13}, {5, 13, 6},
+{6, 13, 12}, {6, 12, 7}, {7, 12, 11}, {7, 11, 8}, {8, 11, 10}, {8, 10, 9}};
static float menu_tria_vert[6][2]= {
{-0.41, 0.16}, {0.41, 0.16}, {0, 0.82},
@@ -451,15 +455,50 @@ static void widget_num_tria(uiWidgetTrias *tria, rcti *rect, float triasize, cha
i2=0; i1= 1;
}
- for(a=0; a<19; a++) {
+ for(a=0; a<3; a++) {
tria->vec[a][0]= sizex*num_tria_vert[a][i1] + centx;
tria->vec[a][1]= sizey*num_tria_vert[a][i2] + centy;
}
- tria->tot= 19;
+ tria->tot= 1;
tria->index= num_tria_face;
}
+static void widget_scroll_circle(uiWidgetTrias *tria, rcti *rect, float triasize, char where)
+{
+ float centx, centy, sizex, sizey, minsize;
+ int a, i1=0, i2=1;
+
+ minsize= MIN2(rect->xmax-rect->xmin, rect->ymax-rect->ymin);
+
+ /* center position and size */
+ centx= (float)rect->xmin + 0.5f*minsize;
+ centy= (float)rect->ymin + 0.5f*minsize;
+ sizex= sizey= -0.5f*triasize*minsize;
+
+ if(where=='r') {
+ centx= (float)rect->xmax - 0.5f*minsize;
+ sizex= -sizex;
+ }
+ else if(where=='t') {
+ centy= (float)rect->ymax - 0.5f*minsize;
+ sizey= -sizey;
+ i2=0; i1= 1;
+ }
+ else if(where=='b') {
+ sizex= -sizex;
+ i2=0; i1= 1;
+ }
+
+ for(a=0; a<16; a++) {
+ tria->vec[a][0]= sizex*scroll_circle_vert[a][i1] + centx;
+ tria->vec[a][1]= sizey*scroll_circle_vert[a][i2] + centy;
+ }
+
+ tria->tot= 14;
+ tria->index= scroll_circle_face;
+}
+
static void widget_trias_draw(uiWidgetTrias *tria)
{
int a;
@@ -1647,8 +1686,8 @@ static int ui_link_bezier_points(rcti *rect, float coord_array[][2], int resol)
vec[2][0]= vec[3][0]-dist;
vec[2][1]= vec[3][1];
- forward_diff_bezier(vec[0][0], vec[1][0], vec[2][0], vec[3][0], coord_array[0], resol, 2);
- forward_diff_bezier(vec[0][1], vec[1][1], vec[2][1], vec[3][1], coord_array[0]+1, resol, 2);
+ forward_diff_bezier(vec[0][0], vec[1][0], vec[2][0], vec[3][0], coord_array[0], resol, sizeof(float)*2);
+ forward_diff_bezier(vec[0][1], vec[1][1], vec[2][1], vec[3][1], coord_array[0]+1, resol, sizeof(float)*2);
return 1;
}
@@ -1736,12 +1775,12 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, rcti *rect, rcti *slider, int stat
wcol->item[3]= 255;
if(horizontal) {
- widget_num_tria(&wtb.tria1, slider, 0.6f, 'l');
- widget_num_tria(&wtb.tria2, slider, 0.6f, 'r');
+ widget_scroll_circle(&wtb.tria1, slider, 0.6f, 'l');
+ widget_scroll_circle(&wtb.tria2, slider, 0.6f, 'r');
}
else {
- widget_num_tria(&wtb.tria1, slider, 0.6f, 'b');
- widget_num_tria(&wtb.tria2, slider, 0.6f, 't');
+ widget_scroll_circle(&wtb.tria1, slider, 0.6f, 'b');
+ widget_scroll_circle(&wtb.tria2, slider, 0.6f, 't');
}
}
widgetbase_draw(&wtb, wcol);
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index d21aabb5e2d..eaa42fc887f 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1252,6 +1252,18 @@ void init_userdef_do_versions(void)
SETCOLF(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0);
}
}
+
+ if (G.main->versionfile < 250 || (G.main->versionfile == 250 && G.main->subversionfile < 3)) {
+ /* new audio system */
+ if(U.audiochannels == 0)
+ U.audiochannels = 2;
+ if(U.audiodevice == 0)
+ U.audiodevice = 2;
+ if(U.audioformat == 0)
+ U.audioformat = 0x24;
+ if(U.audiorate == 0)
+ U.audiorate = 44100;
+ }
/* GL Texture Garbage Collection (variable abused above!) */
if (U.textimeout == 0) {
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 1e8cda68e6d..3e009884dee 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -235,6 +235,7 @@ static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event)
}
break;
+ case LEFTMOUSE:
case MIDDLEMOUSE:
if (event->val==0) {
/* calculate overall delta mouse-movement for redo */
@@ -256,6 +257,7 @@ void VIEW2D_OT_pan(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Pan View";
+ ot->description= "Pan the view.";
ot->idname= "VIEW2D_OT_pan";
/* api callbacks */
@@ -304,6 +306,7 @@ void VIEW2D_OT_scroll_right(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Scroll Right";
+ ot->description= "Scroll the view right.";
ot->idname= "VIEW2D_OT_scroll_right";
/* api callbacks */
@@ -350,6 +353,7 @@ void VIEW2D_OT_scroll_left(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Scroll Left";
+ ot->description= "Scroll the view left.";
ot->idname= "VIEW2D_OT_scroll_left";
/* api callbacks */
@@ -395,6 +399,7 @@ void VIEW2D_OT_scroll_down(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Scroll Down";
+ ot->description= "Scroll the view down.";
ot->idname= "VIEW2D_OT_scroll_down";
/* api callbacks */
@@ -441,6 +446,7 @@ void VIEW2D_OT_scroll_up(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Scroll Up";
+ ot->description= "Scroll the view up.";
ot->idname= "VIEW2D_OT_scroll_up";
/* api callbacks */
@@ -574,6 +580,7 @@ void VIEW2D_OT_zoom_in(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Zoom In";
+ ot->description= "Zoom in the view.";
ot->idname= "VIEW2D_OT_zoom_in";
/* api callbacks */
@@ -610,6 +617,7 @@ void VIEW2D_OT_zoom_out(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Zoom Out";
+ ot->description= "Zoom out the view.";
ot->idname= "VIEW2D_OT_zoom_out";
/* api callbacks */
@@ -826,6 +834,7 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event)
}
break;
+ case LEFTMOUSE:
case MIDDLEMOUSE:
if (event->val==0) {
/* for redo, store the overall deltas - need to respect zoom-locks here... */
@@ -855,6 +864,7 @@ void VIEW2D_OT_zoom(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Zoom View";
+ ot->description= "Zoom in/out the view.";
ot->idname= "VIEW2D_OT_zoom";
/* api callbacks */
@@ -956,6 +966,7 @@ void VIEW2D_OT_zoom_border(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Zoom to Border";
+ ot->description= "Zoom in the view to the nearest item contained in the border.";
ot->idname= "VIEW2D_OT_zoom_border";
/* api callbacks */
@@ -1295,6 +1306,7 @@ void VIEW2D_OT_scroller_activate(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Scroller Activate";
+ ot->description= "Scroll view by mouse click and drag.";
ot->idname= "VIEW2D_OT_scroller_activate";
/* flags */
@@ -1361,6 +1373,7 @@ void VIEW2D_OT_reset(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Reset View";
+ ot->description= "Reset the view.";
ot->idname= "VIEW2D_OT_reset";
/* api callbacks */