Revision: 50091
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50091
Author:   campbellbarton
Date:     2012-08-21 15:45:17 +0000 (Tue, 21 Aug 2012)
Log Message:
-----------
alt+wheel scrolling over the render slots works again (this didnt support 
scrolling when new interfaces would replace the old ones).

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_handlers.c

Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c 
2012-08-21 15:16:53 UTC (rev 50090)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c 
2012-08-21 15:45:17 UTC (rev 50091)
@@ -2945,9 +2945,11 @@
                        return WM_UI_HANDLER_BREAK;
                }
                else if (ELEM3(but->type, MENU, ICONROW, ICONTEXTROW)) {
-                       
-                       if (event->type == WHEELDOWNMOUSE && event->alt) {
-                               data->value = ui_step_name_menu(but, -1);
+                       if (ELEM(event->type, WHEELDOWNMOUSE, WHEELUPMOUSE) && 
event->alt) {
+                               const int direction = (event->type == 
WHEELDOWNMOUSE) ? -1 : 1;
+
+                               data->value = ui_step_name_menu(but, direction);
+
                                button_activate_state(C, but, 
BUTTON_STATE_EXIT);
                                ui_apply_button(C, but->block, but, data, 1);
 
@@ -2961,17 +2963,16 @@
                                data->postbut = but;
                                data->posttype = BUTTON_ACTIVATE_OVER;
 
-                               return WM_UI_HANDLER_BREAK;
-                       }
-                       else if (event->type == WHEELUPMOUSE && event->alt) {
-                               data->value = ui_step_name_menu(but, 1);
-                               button_activate_state(C, but, 
BUTTON_STATE_EXIT);
-                               ui_apply_button(C, but->block, but, data, 1);
+                               /* without this, a new interface that draws as 
result of the menu change
+                                * won't register that the mouse is over it, eg:
+                                * Alt+MouseWheel over the render slots, 
without this,
+                                * the slot menu fails to switch a second time.
+                                *
+                                * Theactive state of the button could be 
maintained some other way
+                                * and remove this mousemove event.
+                                */
+                               WM_event_add_mousemove(C);
 
-                               /* why this is needed described above */
-                               data->postbut = but;
-                               data->posttype = BUTTON_ACTIVATE_OVER;
-
                                return WM_UI_HANDLER_BREAK;
                        }
                }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to