Todo item: (Luca report in IRC)

Pulldown and other popup menus: this button type exits on release.
While holding mouse you then can move around, but the highlight of button
didn't disappear if you were outside item. The menu then doesn't close
when you release the mouse.
Now highlight goes on/off on mouse moves to show this better.

Implementation note: menu items are coded similar to regular activate
buttons (like for tools). There's no provision to make highlights go
to the next item while holding mouse in menus. That I rather not mess
with now.
This commit is contained in:
2010-12-19 14:39:36 +00:00
parent d7c007c4d5
commit 6cdc631d98

View File

@@ -5196,16 +5196,17 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but)
}
else {
/* deselect the button when moving the mouse away */
/* also de-activate for buttons that only show higlights */
if(ui_mouse_inside_button(ar, but, event->x, event->y)) {
if(!(but->flag & UI_SELECT)) {
but->flag |= UI_SELECT;
but->flag |= (UI_SELECT|UI_ACTIVE);
data->cancel= 0;
ED_region_tag_redraw(data->region);
}
}
else {
if(but->flag & UI_SELECT) {
but->flag &= ~UI_SELECT;
but->flag &= ~(UI_SELECT|UI_ACTIVE);
data->cancel= 1;
ED_region_tag_redraw(data->region);
}