[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54385] trunk/blender: Release todo: added userpref for Mac users having "Natural Scroll" set.
Ton Roosendaal
ton at blender.org
Fri Feb 8 13:12:58 CET 2013
Revision: 54385
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54385
Author: ton
Date: 2013-02-08 12:12:57 +0000 (Fri, 08 Feb 2013)
Log Message:
-----------
Release todo: added userpref for Mac users having "Natural Scroll" set.
As per discussion and analysis of all trackpad usage, we now
follow this convention:
- Blender follows system setting for trackpad direction preference.
- If you set your system to "natural" scroll, we need to invert a couple
of cases in Blender we do "natural" already. Like:
- view rotate (the inversed option just never feels ok)
- scroll active items in list or pulldown menu (up/down is absolute)
- ALT+scroll values in buttons (up/down is absolute)
The new User Preference setting "Trackpad Natural" handles this.
For 2.66 we only have trackpad handling for OS X... so this isn't
affecting trackpad usage in Windows and Linux, which stick to be mapped
to Scroll Wheel still.
(Note: viewrotate now is "natural" always, changing how it worked in the
past weeks).
Modified Paths:
--------------
trunk/blender/release/datafiles/matcaps/license.txt
trunk/blender/release/scripts/startup/bl_ui/space_userpref.py
trunk/blender/source/blender/editors/interface/interface_handlers.c
trunk/blender/source/blender/editors/space_view3d/view3d_edit.c
trunk/blender/source/blender/makesdna/DNA_userdef_types.h
trunk/blender/source/blender/makesrna/intern/rna_userdef.c
Modified: trunk/blender/release/datafiles/matcaps/license.txt
===================================================================
--- trunk/blender/release/datafiles/matcaps/license.txt 2013-02-08 11:23:22 UTC (rev 54384)
+++ trunk/blender/release/datafiles/matcaps/license.txt 2013-02-08 12:12:57 UTC (rev 54385)
@@ -1,3 +1,3 @@
These matcap images are licensed as GNU GPL 2 or later, like the rest of Blender's code.
-Thanks to Kent Trammell, Aidy Burrows, John Herreno , Terry Wallwork for making the pictures.
+Thanks to Kent Trammell, Aidy Burrows, John Herreno , Terry Wallwork and David Silverman for making the pictures.
Modified: trunk/blender/release/scripts/startup/bl_ui/space_userpref.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_userpref.py 2013-02-08 11:23:22 UTC (rev 54384)
+++ trunk/blender/release/scripts/startup/bl_ui/space_userpref.py 2013-02-08 12:12:57 UTC (rev 54385)
@@ -963,6 +963,8 @@
return (userpref.active_section == 'INPUT')
def draw_input_prefs(self, inputs, layout):
+ import sys
+
# General settings
row = layout.row()
col = row.column()
@@ -1015,6 +1017,11 @@
sub.prop(inputs, "invert_zoom_wheel", text="Invert Wheel Zoom Direction")
#sub.prop(view, "wheel_scroll_lines", text="Scroll Lines")
+ if sys.platform == "darwin":
+ sub = col.column()
+ sub.label(text="Trackpad:")
+ sub.prop(inputs, "use_trackpad_natural")
+
col.separator()
sub = col.column()
sub.label(text="NDOF Device:")
Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c 2013-02-08 11:23:22 UTC (rev 54384)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c 2013-02-08 12:12:57 UTC (rev 54385)
@@ -237,8 +237,14 @@
lastdy += dy;
if (ABS(lastdy) > (int)UI_UNIT_Y) {
+ int dy = event->prevy - event->y;
+
+ if (U.uiflag2 & USER_TRACKPAD_NATURAL)
+ dy = -dy;
+
*val = KM_PRESS;
- if (event->prevy - event->y > 0)
+
+ if (dy > 0)
*type = WHEELUPMOUSE;
else
*type = WHEELDOWNMOUSE;
Modified: trunk/blender/source/blender/editors/space_view3d/view3d_edit.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_edit.c 2013-02-08 11:23:22 UTC (rev 54384)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_edit.c 2013-02-08 12:12:57 UTC (rev 54385)
@@ -921,8 +921,12 @@
}
if (event->type == MOUSEPAN) {
- /* invert it, trackpad scroll then follows how you mapped it globally */
- viewrotate_apply(vod, 2 * event->x - event->prevx, 2 * event->y - event->prevy);
+ /* Rotate direction we keep always same */
+ if (U.uiflag2 & USER_TRACKPAD_NATURAL)
+ viewrotate_apply(vod, 2 * event->x - event->prevx, 2 * event->y - event->prevy);
+ else
+ viewrotate_apply(vod, event->prevx, event->prevy);
+
ED_view3d_depth_tag_update(rv3d);
viewops_data_free(C, op);
Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h 2013-02-08 11:23:22 UTC (rev 54384)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h 2013-02-08 12:12:57 UTC (rev 54385)
@@ -568,7 +568,8 @@
/* uiflag2 */
typedef enum eUserpref_UI_Flag2 {
USER_KEEP_SESSION = (1 << 0),
- USER_REGION_OVERLAP = (1 << 1)
+ USER_REGION_OVERLAP = (1 << 1),
+ USER_TRACKPAD_NATURAL = (1 << 2)
} eUserpref_UI_Flag2;
/* Auto-Keying mode */
Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_userdef.c 2013-02-08 11:23:22 UTC (rev 54384)
+++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c 2013-02-08 12:12:57 UTC (rev 54385)
@@ -3549,7 +3549,6 @@
"Draw tool/property regions over the main region, when using Triple Buffer");
RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
-
#ifdef WITH_CYCLES
prop = RNA_def_property(srna, "compute_device_type", PROP_ENUM, PROP_NONE);
RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT);
@@ -3755,6 +3754,11 @@
RNA_def_property_range(prop, 0, 32);
RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "Number of lines scrolled at a time with the mouse wheel");
+ prop = RNA_def_property(srna, "use_trackpad_natural", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "uiflag2", USER_TRACKPAD_NATURAL);
+ RNA_def_property_ui_text(prop, "Trackpad Natural",
+ "If your system uses 'natural' scrolling, this option keeps consistent trackpad usage throughout the UI");
+
prop = RNA_def_property(srna, "active_keyconfig", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "keyconfigstr");
RNA_def_property_ui_text(prop, "Key Config", "The name of the active key configuration");
More information about the Bf-blender-cvs
mailing list