summaryrefslogtreecommitdiffstats
path: root/library/scrlbar.tcl
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2020-02-02 15:37:45 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2020-02-02 15:37:45 (GMT)
commitff08eb67d0553702103f0b726742ce3de044d30f (patch)
tree51aff1b56dc3aecb13b40ddbddf1be481808b6c3 /library/scrlbar.tcl
parenta130dc0b53b019d3ad917358bdbb623b8699ca2b (diff)
downloadtk-ff08eb67d0553702103f0b726742ce3de044d30f.zip
tk-ff08eb67d0553702103f0b726742ce3de044d30f.tar.gz
tk-ff08eb67d0553702103f0b726742ce3de044d30f.tar.bz2
Implementation for TIP 563: "scrollwheel on horizontal scrollbar scrolls without shift too"
Diffstat (limited to 'library/scrlbar.tcl')
-rw-r--r--library/scrlbar.tcl16
1 files changed, 8 insertions, 8 deletions
diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl
index bce8391..510713a 100644
--- a/library/scrlbar.tcl
+++ b/library/scrlbar.tcl
@@ -131,16 +131,16 @@ bind Scrollbar <<LineEnd>> {
if {[tk windowingsystem] eq "aqua"} {
bind Scrollbar <MouseWheel> {
- tk::ScrollByUnits %W v [expr {-(%D)}]
+ tk::ScrollByUnits %W hv [expr {-(%D)}]
}
bind Scrollbar <Option-MouseWheel> {
- tk::ScrollByUnits %W v [expr {-10 * (%D)}]
+ tk::ScrollByUnits %W hv [expr {-10 * (%D)}]
}
bind Scrollbar <Shift-MouseWheel> {
- tk::ScrollByUnits %W h [expr {-(%D)}]
+ tk::ScrollByUnits %W v [expr {-(%D)}]
}
bind Scrollbar <Shift-Option-MouseWheel> {
- tk::ScrollByUnits %W h [expr {-10 * (%D)}]
+ tk::ScrollByUnits %W v [expr {-10 * (%D)}]
}
} else {
# We must make sure that positive and negative movements are rounded
@@ -151,9 +151,9 @@ if {[tk windowingsystem] eq "aqua"} {
# The following code ensure equal +/- behaviour.
bind Scrollbar <MouseWheel> {
if {%D >= 0} {
- tk::ScrollByUnits %W v [expr {-%D/30}]
+ tk::ScrollByUnits %W hv [expr {-%D/30}]
} else {
- tk::ScrollByUnits %W v [expr {(29-%D)/30}]
+ tk::ScrollByUnits %W hv [expr {(29-%D)/30}]
}
}
bind Scrollbar <Shift-MouseWheel> {
@@ -166,8 +166,8 @@ if {[tk windowingsystem] eq "aqua"} {
}
if {[tk windowingsystem] eq "x11"} {
- bind Scrollbar <Button-4> {tk::ScrollByUnits %W v -5}
- bind Scrollbar <Button-5> {tk::ScrollByUnits %W v 5}
+ bind Scrollbar <Button-4> {tk::ScrollByUnits %W hv -5}
+ bind Scrollbar <Button-5> {tk::ScrollByUnits %W hv 5}
bind Scrollbar <Shift-Button-4> {tk::ScrollByUnits %W h -5}
bind Scrollbar <Shift-Button-5> {tk::ScrollByUnits %W h 5}
bind Scrollbar <Button-6> {tk::ScrollByUnits %W h -5}