Fossil SCM
Improvements to how resizing works in the merge --tk UI.
Commit
e9d1d71669248028442dc95bd7ec1f1ab80201b99a30c8ba835936c0c7c32571
Parent
873b364b925d88d…
1 file changed
+16
-8
+16
-8
| --- src/merge.tcl | ||
| +++ src/merge.tcl | ||
| @@ -217,10 +217,20 @@ | ||
| 217 | 217 | if {$type ne "txt"} { |
| 218 | 218 | $c config -width 6; # $widths($type) |
| 219 | 219 | } |
| 220 | 220 | $c config -state disabled |
| 221 | 221 | } |
| 222 | + set mx $lnA | |
| 223 | + if {$lnB>$mx} {set mx $lnB} | |
| 224 | + if {$lnC>$mx} {set mx $lnC} | |
| 225 | + if {$lnD>$mx} {set mx $lnD} | |
| 226 | + global lnWidth | |
| 227 | + set lnWidth [string length [format %d $mx]] | |
| 228 | + .lnA config -width $lnWidth | |
| 229 | + .lnB config -width $lnWidth | |
| 230 | + .lnC config -width $lnWidth | |
| 231 | + .lnD config -width $lnWidth | |
| 222 | 232 | } |
| 223 | 233 | |
| 224 | 234 | proc viewDiff {idx} { |
| 225 | 235 | .txtA yview $idx |
| 226 | 236 | .txtA xview moveto 0 |
| @@ -553,17 +563,13 @@ | ||
| 553 | 563 | if {[info exists filelist]} { |
| 554 | 564 | pack .bb.filetag .bb.files -side left |
| 555 | 565 | } |
| 556 | 566 | pack .bb.ctxtag .bb.ctx -side left |
| 557 | 567 | pack .bb.search -side left |
| 558 | -grid rowconfigure . 1 -weight 1 | |
| 559 | -set rn 0 | |
| 560 | -foreach {lnwid txtwid} [cols] { | |
| 561 | - grid columnconfigure . $rn -weight 1 -uniform a | |
| 562 | - grid columnconfigure . [expr {$rn+1}] -weight 1 -uniform b | |
| 563 | - incr rn 2 | |
| 564 | -} | |
| 568 | +grid rowconfigure . 1 -weight 1 -minsize [winfo reqheight .nameA] | |
| 569 | +grid rowconfigure . 2 -weight 100 | |
| 570 | +readMerge | |
| 565 | 571 | grid .bb -row 0 -columnspan 8 |
| 566 | 572 | grid .nameA -row 1 -column 1 -sticky ew |
| 567 | 573 | grid .nameB -row 1 -column 3 -sticky ew |
| 568 | 574 | grid .nameC -row 1 -column 5 -sticky ew |
| 569 | 575 | grid .nameD -row 1 -column 7 -sticky ew |
| @@ -571,9 +577,11 @@ | ||
| 571 | 577 | grid .sby -row 2 -column 8 -sticky ns |
| 572 | 578 | grid .sbxA -row 3 -column 1 -sticky ew |
| 573 | 579 | grid .sbxB -row 3 -column 3 -sticky ew |
| 574 | 580 | grid .sbxC -row 3 -column 5 -sticky ew |
| 575 | 581 | grid .sbxD -row 3 -column 7 -sticky ew |
| 576 | -readMerge | |
| 582 | +grid columnconfigure . {0 2 4 6} \ | |
| 583 | + -weight 1 -uniform a -minsize [winfo reqwidth .lnA] | |
| 584 | +grid columnconfigure . {1 3 5 7} -weight 100 -uniform b | |
| 577 | 585 | |
| 578 | 586 | .spacer config -height [winfo height .sbxA] |
| 579 | 587 | wm deiconify . |
| 580 | 588 |
| --- src/merge.tcl | |
| +++ src/merge.tcl | |
| @@ -217,10 +217,20 @@ | |
| 217 | if {$type ne "txt"} { |
| 218 | $c config -width 6; # $widths($type) |
| 219 | } |
| 220 | $c config -state disabled |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | proc viewDiff {idx} { |
| 225 | .txtA yview $idx |
| 226 | .txtA xview moveto 0 |
| @@ -553,17 +563,13 @@ | |
| 553 | if {[info exists filelist]} { |
| 554 | pack .bb.filetag .bb.files -side left |
| 555 | } |
| 556 | pack .bb.ctxtag .bb.ctx -side left |
| 557 | pack .bb.search -side left |
| 558 | grid rowconfigure . 1 -weight 1 |
| 559 | set rn 0 |
| 560 | foreach {lnwid txtwid} [cols] { |
| 561 | grid columnconfigure . $rn -weight 1 -uniform a |
| 562 | grid columnconfigure . [expr {$rn+1}] -weight 1 -uniform b |
| 563 | incr rn 2 |
| 564 | } |
| 565 | grid .bb -row 0 -columnspan 8 |
| 566 | grid .nameA -row 1 -column 1 -sticky ew |
| 567 | grid .nameB -row 1 -column 3 -sticky ew |
| 568 | grid .nameC -row 1 -column 5 -sticky ew |
| 569 | grid .nameD -row 1 -column 7 -sticky ew |
| @@ -571,9 +577,11 @@ | |
| 571 | grid .sby -row 2 -column 8 -sticky ns |
| 572 | grid .sbxA -row 3 -column 1 -sticky ew |
| 573 | grid .sbxB -row 3 -column 3 -sticky ew |
| 574 | grid .sbxC -row 3 -column 5 -sticky ew |
| 575 | grid .sbxD -row 3 -column 7 -sticky ew |
| 576 | readMerge |
| 577 | |
| 578 | .spacer config -height [winfo height .sbxA] |
| 579 | wm deiconify . |
| 580 |
| --- src/merge.tcl | |
| +++ src/merge.tcl | |
| @@ -217,10 +217,20 @@ | |
| 217 | if {$type ne "txt"} { |
| 218 | $c config -width 6; # $widths($type) |
| 219 | } |
| 220 | $c config -state disabled |
| 221 | } |
| 222 | set mx $lnA |
| 223 | if {$lnB>$mx} {set mx $lnB} |
| 224 | if {$lnC>$mx} {set mx $lnC} |
| 225 | if {$lnD>$mx} {set mx $lnD} |
| 226 | global lnWidth |
| 227 | set lnWidth [string length [format %d $mx]] |
| 228 | .lnA config -width $lnWidth |
| 229 | .lnB config -width $lnWidth |
| 230 | .lnC config -width $lnWidth |
| 231 | .lnD config -width $lnWidth |
| 232 | } |
| 233 | |
| 234 | proc viewDiff {idx} { |
| 235 | .txtA yview $idx |
| 236 | .txtA xview moveto 0 |
| @@ -553,17 +563,13 @@ | |
| 563 | if {[info exists filelist]} { |
| 564 | pack .bb.filetag .bb.files -side left |
| 565 | } |
| 566 | pack .bb.ctxtag .bb.ctx -side left |
| 567 | pack .bb.search -side left |
| 568 | grid rowconfigure . 1 -weight 1 -minsize [winfo reqheight .nameA] |
| 569 | grid rowconfigure . 2 -weight 100 |
| 570 | readMerge |
| 571 | grid .bb -row 0 -columnspan 8 |
| 572 | grid .nameA -row 1 -column 1 -sticky ew |
| 573 | grid .nameB -row 1 -column 3 -sticky ew |
| 574 | grid .nameC -row 1 -column 5 -sticky ew |
| 575 | grid .nameD -row 1 -column 7 -sticky ew |
| @@ -571,9 +577,11 @@ | |
| 577 | grid .sby -row 2 -column 8 -sticky ns |
| 578 | grid .sbxA -row 3 -column 1 -sticky ew |
| 579 | grid .sbxB -row 3 -column 3 -sticky ew |
| 580 | grid .sbxC -row 3 -column 5 -sticky ew |
| 581 | grid .sbxD -row 3 -column 7 -sticky ew |
| 582 | grid columnconfigure . {0 2 4 6} \ |
| 583 | -weight 1 -uniform a -minsize [winfo reqwidth .lnA] |
| 584 | grid columnconfigure . {1 3 5 7} -weight 100 -uniform b |
| 585 | |
| 586 | .spacer config -height [winfo height .sbxA] |
| 587 | wm deiconify . |
| 588 |