forked from bartvdbraak/blender
Bug fix, irc report.
Move to layer buttons, using SHIFT+hotkeys to set button values and use mouse to press OK undid the last change, this due to active flag hanging on that button. It now clears hotkey active flags on mouseclick first.
This commit is contained in:
parent
46fbe6b01e
commit
39022ffb88
@ -3112,7 +3112,7 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent)
|
||||
case LEFTARROWKEY: // later on implement opening/closing sublevels of pupmenus
|
||||
case RIGHTARROWKEY:
|
||||
break;
|
||||
|
||||
|
||||
case PAD8: case PAD2:
|
||||
case UPARROWKEY:
|
||||
case DOWNARROWKEY:
|
||||
@ -3261,7 +3261,10 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent)
|
||||
default:
|
||||
|
||||
for(but= block->buttons.first; but; but= but->next) {
|
||||
|
||||
|
||||
// active flag clear, it can have been set with number keys or arrows, prevents next loop from wrong selection on click
|
||||
if(uevent->event==LEFTMOUSE) but->flag &= ~UI_ACTIVE;
|
||||
|
||||
but->flag &= ~UI_MOUSE_OVER;
|
||||
|
||||
/* check boundbox */
|
||||
@ -3328,7 +3331,7 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent)
|
||||
/* when mouse outside, don't do button */
|
||||
if(inside || uevent->event!=LEFTMOUSE) {
|
||||
butevent= ui_do_button(block, but, uevent);
|
||||
|
||||
|
||||
/* add undo pushes if... */
|
||||
if( !(block->flag & UI_BLOCK_LOOP)) {
|
||||
if(!G.obedit) {
|
||||
|
@ -1235,6 +1235,8 @@ int movetolayer_buts(unsigned int *lay)
|
||||
dx= (sizex-5)/12;
|
||||
dy= sizey/2;
|
||||
|
||||
/* buttons have 0 as return event, to prevent menu to close on hotkeys */
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
for(a=0; a<5; a++)
|
||||
uiDefButI(block, TOGR|BIT|a, 0, "",(short)(x1+a*dx),(short)(y1+dy),(short)dx,(short)dy, lay, 0, 0, 0, 0, "");
|
||||
|
Loading…
Reference in New Issue
Block a user