diff options
author | fvogel <fvogelnew1@free.fr> | 2019-11-02 13:51:28 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2019-11-02 13:51:28 (GMT) |
commit | 0e62c201c749c1c240f1c79f01ddbabf8a308d74 (patch) | |
tree | 5b594c582400b1ae01cd8d392bc4c43b19a78d73 /library | |
parent | 32a561c08576d3913b7d2b459739e58ee7d8f91a (diff) | |
download | tk-0e62c201c749c1c240f1c79f01ddbabf8a308d74.zip tk-0e62c201c749c1c240f1c79f01ddbabf8a308d74.tar.gz tk-0e62c201c749c1c240f1c79f01ddbabf8a308d74.tar.bz2 |
Fix [b3b56ae8dc]: ttk widgets overwrite user-set -cursor option. Case of the ttk::combobox, ttk::spinbox and ttk::panedwindow.
Diffstat (limited to 'library')
-rw-r--r-- | library/ttk/combobox.tcl | 10 | ||||
-rw-r--r-- | library/ttk/panedwindow.tcl | 23 | ||||
-rw-r--r-- | library/ttk/spinbox.tcl | 10 |
3 files changed, 39 insertions, 4 deletions
diff --git a/library/ttk/combobox.tcl b/library/ttk/combobox.tcl index 1355a04..30a1599 100644 --- a/library/ttk/combobox.tcl +++ b/library/ttk/combobox.tcl @@ -149,12 +149,20 @@ proc ttk::combobox::Drag {w x} { # Set cursor. # proc ttk::combobox::Motion {w x y} { + variable State + if {![info exists State(userConfCursor)]} { + set State(userConfCursor) [$w cget -cursor] + } + # the user could have changed the configured cursor + if {[$w cget -cursor] ne [ttk::cursor text]} { + set State(userConfCursor) [$w cget -cursor] + } if { [$w identify $x $y] eq "textarea" && [$w instate {!readonly !disabled}] } { ttk::setCursor $w text } else { - ttk::setCursor $w "" + ttk::setCursor $w $State(userConfCursor) } } diff --git a/library/ttk/panedwindow.tcl b/library/ttk/panedwindow.tcl index a2e073b..e23c506 100644 --- a/library/ttk/panedwindow.tcl +++ b/library/ttk/panedwindow.tcl @@ -62,13 +62,32 @@ proc ttk::panedwindow::Release {w x y} { # proc ttk::panedwindow::ResetCursor {w} { variable State + + if {![info exists State(userConfCursor)]} { + set State(userConfCursor) [$w cget -cursor] + } + # the user could have changed the configured cursor + if {[$w cget -cursor] ni [list [ttk::cursor hresize] [ttk::cursor vresize]]} { + set State(userConfCursor) [$w cget -cursor] + } + if {!$State(pressed)} { - ttk::setCursor $w {} + ttk::setCursor $w $State(userConfCursor) } } proc ttk::panedwindow::SetCursor {w x y} { - set cursor "" + variable State + + if {![info exists State(userConfCursor)]} { + set State(userConfCursor) [$w cget -cursor] + } + # the user could have changed the configured cursor + if {[$w cget -cursor] ni [list [ttk::cursor hresize] [ttk::cursor vresize]]} { + set State(userConfCursor) [$w cget -cursor] + } + + set cursor $State(userConfCursor) if {[llength [$w identify $x $y]]} { # Assume we're over a sash. switch -- [$w cget -orient] { diff --git a/library/ttk/spinbox.tcl b/library/ttk/spinbox.tcl index 90a1572..b6ed126 100644 --- a/library/ttk/spinbox.tcl +++ b/library/ttk/spinbox.tcl @@ -29,12 +29,20 @@ ttk::bindMouseWheel TSpinbox [list ttk::spinbox::MouseWheel %W] # Sets cursor. # proc ttk::spinbox::Motion {w x y} { + variable State + if {![info exists State(userConfCursor)]} { + set State(userConfCursor) [$w cget -cursor] + } + # the user could have changed the configured cursor + if {[$w cget -cursor] ne [ttk::cursor text]} { + set State(userConfCursor) [$w cget -cursor] + } if { [$w identify $x $y] eq "textarea" && [$w instate {!readonly !disabled}] } { ttk::setCursor $w text } else { - ttk::setCursor $w "" + ttk::setCursor $w $State(userConfCursor) } } |