diff options
Diffstat (limited to 'source/blender/src/interface.c')
-rw-r--r-- | source/blender/src/interface.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c index ede18300a8d..c6397ae2f8b 100644 --- a/source/blender/src/interface.c +++ b/source/blender/src/interface.c @@ -3250,10 +3250,19 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent) if(inside || uevent->event!=LEFTMOUSE) { butevent= ui_do_button(block, but, uevent); - if( !(block->flag & UI_BLOCK_LOOP)) - if(but->type!=BLOCK && but->type!=MENU) - if(!G.obedit) - BIF_undo_push(but->str); + /* add undo pushes if... */ + if( !(block->flag & UI_BLOCK_LOOP)) { + if(!G.obedit) { + if ELEM4(but->type, BLOCK, BUT, LABEL, PULLDOWN); + else { + /* define which string to use for undo */ + if ELEM(but->type, LINK, INLINK) BIF_undo_push("Add button link"); + else if ELEM(but->type, MENU, ICONTEXTROW) BIF_undo_push(but->drawstr); + else if(but->str[0]) BIF_undo_push(but->str); + else BIF_undo_push(but->tip); + } + } + } if(butevent) addqueue(block->winq, UI_BUT_EVENT, (short)butevent); |