diff options
author | pspjuth <peter.spjuth@gmail.com> | 2020-03-09 23:06:41 (GMT) |
---|---|---|
committer | pspjuth <peter.spjuth@gmail.com> | 2020-03-09 23:06:41 (GMT) |
commit | 7a6dcdcdb4055e68aa0277d892439b7a8af762f8 (patch) | |
tree | 75ca8753fe3027de4f28bda455594bb0b0b3c0ae /library | |
parent | 9356ee863d83233a4d0c6a65b8142853caf6934b (diff) | |
parent | 27b0de091309ba8cfb6e6d6d368f5da3311a42f3 (diff) | |
download | tk-7a6dcdcdb4055e68aa0277d892439b7a8af762f8.zip tk-7a6dcdcdb4055e68aa0277d892439b7a8af762f8.tar.gz tk-7a6dcdcdb4055e68aa0277d892439b7a8af762f8.tar.bz2 |
Merge trunk
Diffstat (limited to 'library')
-rw-r--r-- | library/scrlbar.tcl | 31 | ||||
-rw-r--r-- | library/ttk/fonts.tcl | 12 | ||||
-rw-r--r-- | library/ttk/scrollbar.tcl | 7 |
3 files changed, 15 insertions, 35 deletions
diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index bce8391..8106b3d 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -131,16 +131,10 @@ 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)}] - } - bind Scrollbar <Shift-MouseWheel> { - tk::ScrollByUnits %W h [expr {-(%D)}] - } - bind Scrollbar <Shift-Option-MouseWheel> { - tk::ScrollByUnits %W h [expr {-10 * (%D)}] + tk::ScrollByUnits %W hv [expr {-10 * (%D)}] } } else { # We must make sure that positive and negative movements are rounded @@ -151,27 +145,18 @@ if {[tk windowingsystem] eq "aqua"} { # The following code ensure equal +/- behaviour. bind Scrollbar <MouseWheel> { if {%D >= 0} { - tk::ScrollByUnits %W v [expr {-%D/30}] - } else { - tk::ScrollByUnits %W v [expr {(29-%D)/30}] - } - } - bind Scrollbar <Shift-MouseWheel> { - if {%D >= 0} { - tk::ScrollByUnits %W h [expr {-%D/30}] + tk::ScrollByUnits %W hv [expr {-%D/30}] } else { - tk::ScrollByUnits %W h [expr {(29-%D)/30}] + tk::ScrollByUnits %W hv [expr {(29-%D)/30}] } } } 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 <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} - bind Scrollbar <Button-7> {tk::ScrollByUnits %W h 5} + bind Scrollbar <Button-4> {tk::ScrollByUnits %W hv -5} + bind Scrollbar <Button-5> {tk::ScrollByUnits %W hv 5} + bind Scrollbar <Button-6> {tk::ScrollByUnits %W hv -5} + bind Scrollbar <Button-7> {tk::ScrollByUnits %W hv 5} } # tk::ScrollButtonDown -- diff --git a/library/ttk/fonts.tcl b/library/ttk/fonts.tcl index a2781c6..d819973 100644 --- a/library/ttk/fonts.tcl +++ b/library/ttk/fonts.tcl @@ -53,10 +53,6 @@ # Most other toolkits use medium weight for all UI elements, # which is what we do now. # -# Font size specified in pixels on X11, not points. -# This is Theoretically Wrong, but in practice works better; using -# points leads to huge inconsistencies across different servers. -# namespace eval ttk { @@ -131,10 +127,10 @@ switch -- [tk windowingsystem] { set F(family) "Helvetica" set F(fixed) "courier" } - set F(size) -12 - set F(ttsize) -10 - set F(capsize) -14 - set F(fixedsize) -12 + set F(size) 10 + set F(ttsize) 9 + set F(capsize) 12 + set F(fixedsize) 10 font configure TkDefaultFont -family $F(family) -size $F(size) font configure TkTextFont -family $F(family) -size $F(size) diff --git a/library/ttk/scrollbar.tcl b/library/ttk/scrollbar.tcl index 15f9cde..7537491 100644 --- a/library/ttk/scrollbar.tcl +++ b/library/ttk/scrollbar.tcl @@ -21,14 +21,13 @@ bind TScrollbar <ButtonRelease-2> { ttk::scrollbar::Release %W %x %y } # # The shift-bindings scroll left/right (not up/down) # if a widget has both possibilities -set eventList [list <MouseWheel> <Shift-MouseWheel>] +set eventList [list <MouseWheel>] switch [tk windowingsystem] { aqua { - lappend eventList <Option-MouseWheel> <Shift-Option-MouseWheel> + lappend eventList <Option-MouseWheel> } x11 { - lappend eventList <Button-4> <Button-5> <Button-6> <Button-7>\ - <Shift-Button-4> <Shift-Button-5> + lappend eventList <Button-4> <Button-5> <Button-6> <Button-7> } } foreach event $eventList { |