diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-07-25 16:07:02 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-07-25 16:07:02 (GMT) |
commit | fda72faf1d67dd4016bf6842a6448943bd324707 (patch) | |
tree | b548a211106c683957d4631e5229f7fb1e3625b4 /library/ttk | |
parent | 5c07a1409bb742e9fe41e7e523146ce75d71580a (diff) | |
parent | 02adf45068f997e84707a3479e629b74b5409671 (diff) | |
download | tk-fda72faf1d67dd4016bf6842a6448943bd324707.zip tk-fda72faf1d67dd4016bf6842a6448943bd324707.tar.gz tk-fda72faf1d67dd4016bf6842a6448943bd324707.tar.bz2 |
Experiment: Handle scaling fractors for the ScrollWheel sensibly. Trying "40" as a good general scale factor (compared to "50" on X11 and "120" on Win32 and "1" on Aqua)
Diffstat (limited to 'library/ttk')
-rw-r--r-- | library/ttk/utils.tcl | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/library/ttk/utils.tcl b/library/ttk/utils.tcl index 7cc1bb7..140e061 100644 --- a/library/ttk/utils.tcl +++ b/library/ttk/utils.tcl @@ -273,21 +273,6 @@ proc ttk::copyBindings {from to} { # # Platform inconsistencies: # -# On X11, the server typically maps the mouse wheel to Button4 and Button5. -# -# On OSX, Tk generates sensible values for the %D field in <MouseWheel> events. -# -# On Windows, %D must be scaled by a factor of 120. -# In addition, Tk redirects mousewheel events to the window with -# keyboard focus instead of sending them to the window under the pointer. -# We do not attempt to fix that here, see also TIP#171. -# -# OSX conventionally uses Shift+MouseWheel for horizontal scrolling, -# and Option+MouseWheel for accelerated scrolling. -# -# The Shift+MouseWheel behavior is not conventional on Windows or most -# X11 toolkits, but it's useful. -# # MouseWheel scrolling is accelerated on X11, which is conventional # for Tk and appears to be conventional for other toolkits (although # Gtk+ and Qt do not appear to use as large a factor). @@ -300,18 +285,7 @@ proc ttk::copyBindings {from to} { # proc ttk::bindMouseWheel {bindtag callback} { - switch -- [tk windowingsystem] { - x11 { - bind $bindtag <ButtonPress-4> "$callback -1" - bind $bindtag <ButtonPress-5> "$callback +1" - } - win32 { - bind $bindtag <MouseWheel> [append callback { [expr {-(%D/120)}]}] - } - aqua { - bind $bindtag <MouseWheel> [append callback { [expr {-(%D)}]} ] - } - } + bind $bindtag <MouseWheel> [append callback { [expr {-(%D/40)}]}] } ## Mousewheel bindings for standard scrollable widgets. |