git-gui: Fix mouse cursor behavior when in widgets.
The mouse cursor (at least on Windows) seemed to be picking up the cursor from the sash controls and then never resetting itself back to the standard text cursor (the I-beam) when it was over a text area that the user can edit (like the commit buffer) or over a text area the user can copy from (like the diff viewer). So now we always set the cursor to left_ptr (which according to the Tk documentation should be available everywhere) and only for the two text areas which we use to list file names, as the user clicks in these but is not permitted to select text. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Nov 11, 2006 at 20:33 UTC
6c6dd01a041e628ce6efb583ea865d1a694ff7b2
1 file changed
+4
-6
git-gui
+4
-6
@@ -1563,7 +1563,7 @@ proc unclick {w x y} {
1563
1564
set font_ui {Helvetica 10}
1565
set font_diff {Courier 10}
1566
-set maincursor [. cget -cursor]
1566
+set cursor_ptr left_ptr
1567
1568
switch -glob -- "$tcl_platform(platform),$tcl_platform(os)" {
1569
windows,* {set M1B Control; set M1T Ctrl}
@@ -1690,8 +1690,8 @@ label .vpane.files.index.title -text {Modified Files} \
1690
text $ui_index -background white -borderwidth 0 \
1691
-width 40 -height 10 \
1692
-font $font_ui \
1693
+ -cursor $cursor_ptr \
1694
-yscrollcommand {.vpane.files.index.sb set} \
1694
- -cursor $maincursor \
1695
-state disabled
1696
scrollbar .vpane.files.index.sb -command [list $ui_index yview]
1697
pack .vpane.files.index.title -side top -fill x
@@ -1707,8 +1707,8 @@ label .vpane.files.other.title -text {Untracked Files} \
1707
text $ui_other -background white -borderwidth 0 \
1708
-width 40 -height 10 \
1709
-font $font_ui \
1710
+ -cursor $cursor_ptr \
1711
-yscrollcommand {.vpane.files.other.sb set} \
1711
- -cursor $maincursor \
1712
-state disabled
1713
scrollbar .vpane.files.other.sb -command [list $ui_other yview]
1714
pack .vpane.files.other.title -side top -fill x
@@ -1791,8 +1791,7 @@ text $ui_comm -background white -borderwidth 1 \
1791
-relief sunken \
1792
-width 75 -height 9 -wrap none \
1793
-font $font_diff \
1794
- -yscrollcommand {.vpane.lower.commarea.buffer.sby set} \
1795
- -cursor $maincursor
1794
+ -yscrollcommand {.vpane.lower.commarea.buffer.sby set}
1795
scrollbar .vpane.lower.commarea.buffer.sby \
1796
-command [list $ui_comm yview]
1797
pack $ui_coml -side top -fill x
@@ -1866,7 +1865,6 @@ text $ui_diff -background white -borderwidth 0 \
1865
-font $font_diff \
1866
-xscrollcommand {.vpane.lower.diff.body.sbx set} \
1867
-yscrollcommand {.vpane.lower.diff.body.sby set} \
1869
- -cursor $maincursor \
1868
-state disabled
1869
scrollbar .vpane.lower.diff.body.sbx -orient horizontal \
1870
-command [list $ui_diff xview]