2268
global canv cflist ctext
2269
bindall <MouseWheel> {allcanvs yview scroll [scrollval %D] units}
2270
bindall <Shift-MouseWheel> break
2271
- bind $ctext <MouseWheel> {$ctext yview scroll [scrollval %D] units}
2272
- bind $ctext <Shift-MouseWheel> {$ctext xview scroll [scrollval %D] units}
2273
- bind $cflist <MouseWheel> {$cflist yview scroll [scrollval %D] units}
2271
+ bind $ctext <MouseWheel> {$ctext yview scroll [scrollval %D 2] units}
2272
+ bind $ctext <Shift-MouseWheel> {$ctext xview scroll [scrollval %D 2] units}
2273
+ bind $cflist <MouseWheel> {$cflist yview scroll [scrollval %D 2] units}
2274
bind $cflist <Shift-MouseWheel> break
2275
}
2276
2293
global fprogitem fprogcoord lastprogupdate progupdatepending
2294
global rprogitem rprogcoord rownumsel numcommits
2295
global worddiff
2296
+ global scroll_D0
2297
2298
# The "mc" arguments here are purely so that xgettext
2299
# sees the following string as needing to be translated
2710
2711
pack .ctop -fill both -expand 1
2712
bindall <1> {selcanvline %W %x %y}
2712
- #bindall <B1-Motion> {selcanvline %W %x %y}
2713
+
2714
+ #Mouse / touchpad scrolling
2715
if {[tk windowingsystem] == "win32"} {
2714
- bind . <MouseWheel> { windows_mousewheel_redirector %W %X %Y %D }
2715
- bind $ctext <MouseWheel> { windows_mousewheel_redirector %W %X %Y %D ; break }
2716
+ set scroll_D0 120
2717
+ bind_mousewheel
2718
} elseif {[tk windowingsystem] == "x11"} {
2719
bindall <ButtonRelease-4> "allcanvs yview scroll -5 units"
2720
bindall <ButtonRelease-5> "allcanvs yview scroll 5 units"
2875
$diff_menu configure -tearoff 0
2876
}
2877
2876
-# Windows sends all mouse wheel events to the current focused window, not
2877
-# the one where the mouse hovers, so bind those events here and redirect
2878
-# to the correct window
2879
-proc windows_mousewheel_redirector {W X Y D} {
2880
- global canv canv2 canv3
2881
- set w [winfo containing -displayof $W $X $Y]
2882
- if {$w ne ""} {
2883
- set u [expr {$D < 0 ? 5 : -5}]
2884
- if {$w == $canv || $w == $canv2 || $w == $canv3} {
2885
- allcanvs yview scroll $u units
2886
- } else {
2887
- catch {
2888
- $w yview scroll $u units
2889
- }
2890
- }
2891
- }
2892
-}
2893
-
2878
# Update row number label when selectedline changes
2879
proc selectedline_change {n1 n2 op} {
2880
global selectedline rownumsel