fix more scroll issues on linux (pass y coord of sub-canvasses to mousewheel event)

This commit is contained in:
Seb Shader 2022-10-28 18:22:37 -07:00
parent c793142eb1
commit f7260808ed

View file

@ -211,6 +211,7 @@ proc ::color-themes::click {box} {
proc ::color-themes::scroll {box coord units boxincr} { proc ::color-themes::scroll {box coord units boxincr} {
variable num_themes variable num_themes
# not sure of a better way to simulate hovering.. # not sure of a better way to simulate hovering..
#::pdwindow::post "box: $box coord: $coord units: $units boxincr: $boxincr\n"
set ocanvy [.colortheme_dialog.theme_list.c canvasy 0] set ocanvy [.colortheme_dialog.theme_list.c canvasy 0]
.colortheme_dialog.theme_list.c yview scroll [expr {- ($units)}] units .colortheme_dialog.theme_list.c yview scroll [expr {- ($units)}] units
{::color-themes::motion} [expr max(0, min($box + int($coord + \ {::color-themes::motion} [expr max(0, min($box + int($coord + \
@ -321,9 +322,9 @@ proc ::color-themes::opendialog {} {
if {$::windowingsystem eq "x11"} { if {$::windowingsystem eq "x11"} {
# from http://wiki.tcl.tk/3893 # from http://wiki.tcl.tk/3893
bind .colortheme_dialog.theme_list.c.f$counter.c <Button-4> \ bind .colortheme_dialog.theme_list.c.f$counter.c <Button-4> \
{event generate %W <MouseWheel> -delta 1} {event generate %W <MouseWheel> -delta 1 -y %y}
bind .colortheme_dialog.theme_list.c.f$counter.c <Button-5> \ bind .colortheme_dialog.theme_list.c.f$counter.c <Button-5> \
{event generate %W <MouseWheel> -delta -1} {event generate %W <MouseWheel> -delta -1 -y %y}
} }
bind .colortheme_dialog.theme_list.c.f$counter.c <Motion> \ bind .colortheme_dialog.theme_list.c.f$counter.c <Motion> \
[list {::color-themes::motion} $counter] [list {::color-themes::motion} $counter]