[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34044] trunk/blender/source/blender: Todo item

Ton Roosendaal ton at blender.org
Mon Jan 3 18:00:50 CET 2011


Revision: 34044
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=34044
Author:   ton
Date:     2011-01-03 18:00:49 +0100 (Mon, 03 Jan 2011)

Log Message:
-----------
Todo item

Drag/drop now has a User preset for dragging threshold.
Noticed this was set to 3 pixels even, made it 5 as default.
Tablet owners can put it larger too :)

Note: the tweak-threshold (3d win) is 10 pixels now, I think
this needs another preset too, leave this for now.

Also: fixed crash in filewindow: drag .blend icon and drop it.
You can't test anything in Blender or you get a bug :)

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_handlers.c
    trunk/blender/source/blender/editors/interface/resources.c
    trunk/blender/source/blender/makesdna/DNA_userdef_types.h
    trunk/blender/source/blender/makesrna/intern/rna_userdef.c
    trunk/blender/source/blender/windowmanager/intern/wm_event_system.c

Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c	2011-01-03 16:22:30 UTC (rev 34043)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c	2011-01-03 17:00:49 UTC (rev 34044)
@@ -646,13 +646,12 @@
 	return BLI_in_rcti(&rect, x, y);
 }
 
-#define UI_DRAG_THRESHOLD	3
 static int ui_but_start_drag(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
 {
 	/* prevent other WM gestures to start while we try to drag */
 	WM_gestures_remove(C);
 
-	if( ABS(data->dragstartx - event->x) + ABS(data->dragstarty - event->y) > UI_DRAG_THRESHOLD ) {
+	if( ABS(data->dragstartx - event->x) + ABS(data->dragstarty - event->y) > U.dragthreshold ) {
 		wmDrag *drag;
 		
 		button_activate_state(C, but, BUTTON_STATE_EXIT);

Modified: trunk/blender/source/blender/editors/interface/resources.c
===================================================================
--- trunk/blender/source/blender/editors/interface/resources.c	2011-01-03 16:22:30 UTC (rev 34043)
+++ trunk/blender/source/blender/editors/interface/resources.c	2011-01-03 17:00:49 UTC (rev 34044)
@@ -1527,7 +1527,7 @@
 		U.dbl_click_time = 350;
 	}
 	if (U.anim_player_preset == 0) {
-		U.anim_player_preset =1 ;
+		U.anim_player_preset = 1 ;
 	}
 	if (U.scrcastfps == 0) {
 		U.scrcastfps = 10;
@@ -1536,6 +1536,8 @@
 	if (U.v2d_min_gridsize == 0) {
 		U.v2d_min_gridsize= 35;
 	}
+	if (U.dragthreshold == 0 )
+		U.dragthreshold= 5;
 
 	/* funny name, but it is GE stuff, moves userdef stuff to engine */
 // XXX	space_set_commmandline_options();

Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h	2011-01-03 16:22:30 UTC (rev 34043)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h	2011-01-03 17:00:49 UTC (rev 34044)
@@ -350,7 +350,7 @@
 	short tw_hotspot, tw_flag, tw_handlesize, tw_size;
 	short textimeout,texcollectrate;
 	short wmdrawmethod; /* removed wmpad */
-	short pad2;
+	short dragthreshold;
 	int memcachelimit;
 	int prefetchframes;
 	short frameserverport;

Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2011-01-03 16:22:30 UTC (rev 34043)
+++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2011-01-03 17:00:49 UTC (rev 34044)
@@ -2676,6 +2676,12 @@
 	RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_CONTINUOUS_MOUSE);
 	RNA_def_property_ui_text(prop, "Continuous Grab", "Allow moving the mouse outside the view on some manipulations (transform, ui control drag)");
 	
+	/* tweak tablet & mouse preset */
+	prop= RNA_def_property(srna, "drag_threshold", PROP_INT, PROP_NONE);
+	RNA_def_property_int_sdna(prop, NULL, "dragthreshold");
+	RNA_def_property_range(prop, 3, 40);
+	RNA_def_property_ui_text(prop, "Drag Threshold", "Amount of pixels you have to drag before dragging UI items happens");
+	
 	prop= RNA_def_property(srna, "ndof_pan_speed", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "ndof_pan");
 	RNA_def_property_range(prop, 0, 200);

Modified: trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_event_system.c	2011-01-03 16:22:30 UTC (rev 34043)
+++ trunk/blender/source/blender/windowmanager/intern/wm_event_system.c	2011-01-03 17:00:49 UTC (rev 34044)
@@ -1478,7 +1478,10 @@
 									//wm_operator_invoke(C, drop->ot, event, drop->ptr, NULL, FALSE);
 									action |= WM_HANDLER_BREAK;
 									
-									/* prevent hanging on file read */
+									/* XXX fileread case */
+									if(CTX_wm_window(C)==NULL)
+										return action;
+									
 									BLI_freelistN(event->customdata);
 									event->customdata= NULL;
 									event->custom= 0;
@@ -1501,7 +1504,7 @@
 			}
 		}
 		
-		/* fileread case */
+		/* XXX fileread case */
 		if(CTX_wm_window(C)==NULL)
 			return action;
 	}





More information about the Bf-blender-cvs mailing list