Fossil SCM

Tk diff: Fix a couple scrollbar issues.

joel 2013-07-18 20:21 trunk
Commit a6c96aea6b61f61a1d2bdebdb91e72cec8254681
1 file changed +8 -7
+8 -7
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -766,11 +766,11 @@
766766
@ disableSync x
767767
@ $col xview moveto [expr {$first*[xvis $col]/($last-$first)}]
768768
@ foreach side {A B} {
769769
@ set sb .sbx$side
770770
@ set xview [.txt$side xview]
771
-@ if {$xview ne "0.0 1.0"} {
771
+@ if {[lindex $xview 0] > 0 || [lindex $xview 1] < 1} {
772772
@ grid $sb
773773
@ eval $sb set $xview
774774
@ } else {
775775
@ grid remove $sb
776776
@ }
@@ -893,23 +893,24 @@
893893
@
894894
@ if {[readDiffs $cmd] == 0} {
895895
@ tk_messageBox -type ok -title $CFG(TITLE) -message "No changes"
896896
@ exit
897897
@ }
898
+@ update idletasks
898899
@
899900
@ grid rowconfigure . 1 -weight 1
900901
@ grid columnconfigure . 1 -weight 1
901902
@ grid columnconfigure . 4 -weight 1
902
-@ grid .files -columnspan 6
903
-@ eval grid [cols] .sby -sticky nsew
904
-@ grid .sbxA -row 2 -column 0 -columnspan 2 -sticky ew
903
+@ grid .files -row 0 -columnspan 6
904
+@ eval grid [cols] -row 1 -sticky nsew
905
+@ grid .sby -row 1 -column 5 -sticky ns
906
+@ grid .sbxA -row 2 -columnspan 2 -sticky ew
905907
@ grid .spacer -row 2 -column 2
906908
@ grid .sbxB -row 2 -column 3 -columnspan 2 -sticky ew
907
-@
908
-@ wm deiconify .
909
-@ update idletasks
909
+@
910910
@ .spacer config -height [winfo height .sbxA]
911
+@ wm deiconify .
911912
;
912913
913914
/*
914915
** Show diff output in a Tcl/Tk window, in response to the --tk option
915916
** to the diff command.
916917
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -766,11 +766,11 @@
766 @ disableSync x
767 @ $col xview moveto [expr {$first*[xvis $col]/($last-$first)}]
768 @ foreach side {A B} {
769 @ set sb .sbx$side
770 @ set xview [.txt$side xview]
771 @ if {$xview ne "0.0 1.0"} {
772 @ grid $sb
773 @ eval $sb set $xview
774 @ } else {
775 @ grid remove $sb
776 @ }
@@ -893,23 +893,24 @@
893 @
894 @ if {[readDiffs $cmd] == 0} {
895 @ tk_messageBox -type ok -title $CFG(TITLE) -message "No changes"
896 @ exit
897 @ }
 
898 @
899 @ grid rowconfigure . 1 -weight 1
900 @ grid columnconfigure . 1 -weight 1
901 @ grid columnconfigure . 4 -weight 1
902 @ grid .files -columnspan 6
903 @ eval grid [cols] .sby -sticky nsew
904 @ grid .sbxA -row 2 -column 0 -columnspan 2 -sticky ew
 
905 @ grid .spacer -row 2 -column 2
906 @ grid .sbxB -row 2 -column 3 -columnspan 2 -sticky ew
907 @
908 @ wm deiconify .
909 @ update idletasks
910 @ .spacer config -height [winfo height .sbxA]
 
911 ;
912
913 /*
914 ** Show diff output in a Tcl/Tk window, in response to the --tk option
915 ** to the diff command.
916
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -766,11 +766,11 @@
766 @ disableSync x
767 @ $col xview moveto [expr {$first*[xvis $col]/($last-$first)}]
768 @ foreach side {A B} {
769 @ set sb .sbx$side
770 @ set xview [.txt$side xview]
771 @ if {[lindex $xview 0] > 0 || [lindex $xview 1] < 1} {
772 @ grid $sb
773 @ eval $sb set $xview
774 @ } else {
775 @ grid remove $sb
776 @ }
@@ -893,23 +893,24 @@
893 @
894 @ if {[readDiffs $cmd] == 0} {
895 @ tk_messageBox -type ok -title $CFG(TITLE) -message "No changes"
896 @ exit
897 @ }
898 @ update idletasks
899 @
900 @ grid rowconfigure . 1 -weight 1
901 @ grid columnconfigure . 1 -weight 1
902 @ grid columnconfigure . 4 -weight 1
903 @ grid .files -row 0 -columnspan 6
904 @ eval grid [cols] -row 1 -sticky nsew
905 @ grid .sby -row 1 -column 5 -sticky ns
906 @ grid .sbxA -row 2 -columnspan 2 -sticky ew
907 @ grid .spacer -row 2 -column 2
908 @ grid .sbxB -row 2 -column 3 -columnspan 2 -sticky ew
909 @
 
 
910 @ .spacer config -height [winfo height .sbxA]
911 @ wm deiconify .
912 ;
913
914 /*
915 ** Show diff output in a Tcl/Tk window, in response to the --tk option
916 ** to the diff command.
917

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button