Three fixes:

- Old issue: on scrolling button views, tooltips could open or stayed open.

- New fix: alt+swipe now changes button values again

- Removed test print, from WIP code project.
This commit is contained in:
Ton Roosendaal
2013-01-06 18:28:39 +00:00
parent 69dd1b0819
commit bbd95fafef
2 changed files with 18 additions and 17 deletions

View File

@@ -238,6 +238,7 @@ void ui_pan_to_scroll(wmEvent *event, int *type, int *val)
*type = WHEELUPMOUSE;
else
*type = WHEELDOWNMOUSE;
lastdy = 0;
}
}
@@ -2717,7 +2718,9 @@ static int ui_do_but_NUM(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
ui_pan_to_scroll(event, &type, &val);
/* XXX hardcoded keymap check.... */
if (type == WHEELDOWNMOUSE && event->alt) {
if (type == MOUSEPAN && event->alt)
retval = WM_UI_HANDLER_BREAK; /* allow accumulating values, otherwise scrolling gets preference */
else if (type == WHEELDOWNMOUSE && event->alt) {
mx = but->rect.xmin;
click = 1;
}
@@ -2945,7 +2948,9 @@ static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
ui_pan_to_scroll(event, &type, &val);
/* XXX hardcoded keymap check.... */
if (type == WHEELDOWNMOUSE && event->alt) {
if (type == MOUSEPAN && event->alt)
retval = WM_UI_HANDLER_BREAK; /* allow accumulating values, otherwise scrolling gets preference */
else if (type == WHEELDOWNMOUSE && event->alt) {
mx = but->rect.xmin;
click = 2;
}
@@ -6010,19 +6015,18 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but)
retval = WM_UI_HANDLER_CONTINUE;
break;
case WHEELUPMOUSE:
case WHEELDOWNMOUSE:
case MIDDLEMOUSE:
/* XXX hardcoded keymap check... but anyway, while view changes, tooltips should be removed */
if (data->tooltiptimer) {
WM_event_remove_timer(data->wm, data->window, data->tooltiptimer);
data->tooltiptimer = NULL;
}
/* pass on purposedly */
default:
/* handle button type specific events */
retval = ui_do_button(C, block, but, event);
}
/* XXX hardcoded keymap check... but anyway, while view changes, tooltips should be removed */
case WHEELUPMOUSE:
case WHEELDOWNMOUSE:
case MIDDLEMOUSE:
case MOUSEPAN:
button_timers_tooltip_remove(C, but);
/* pass on purposedly */
default:
/* handle button type specific events */
retval = ui_do_button(C, block, but, event);
}
}
else if (data->state == BUTTON_STATE_WAIT_RELEASE) {

View File

@@ -886,8 +886,6 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat
ShaderPreview *sp = customdata;
ID *id = sp->id;
short idtype = GS(id->name);
printf("icon start job %s\n", id->name);
if (idtype == ID_IM) {
Image *ima = (Image *)id;
@@ -1012,7 +1010,6 @@ static void icon_preview_endjob(void *customdata)
IconPreview *ip = customdata;
if (ip->id) {
printf("icon end job %s\n", ip->id->name);
if (GS(ip->id->name) == ID_BR)
WM_main_add_notifier(NC_BRUSH | NA_EDITED, ip->id);