Fossil SCM

Improvements to how resizing works in the merge --tk UI.

drh 2024-12-05 18:00 better-merge
Commit e9d1d71669248028442dc95bd7ec1f1ab80201b99a30c8ba835936c0c7c32571
1 file changed +16 -8
+16 -8
--- src/merge.tcl
+++ src/merge.tcl
@@ -217,10 +217,20 @@
217217
if {$type ne "txt"} {
218218
$c config -width 6; # $widths($type)
219219
}
220220
$c config -state disabled
221221
}
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
222232
}
223233
224234
proc viewDiff {idx} {
225235
.txtA yview $idx
226236
.txtA xview moveto 0
@@ -553,17 +563,13 @@
553563
if {[info exists filelist]} {
554564
pack .bb.filetag .bb.files -side left
555565
}
556566
pack .bb.ctxtag .bb.ctx -side left
557567
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
565571
grid .bb -row 0 -columnspan 8
566572
grid .nameA -row 1 -column 1 -sticky ew
567573
grid .nameB -row 1 -column 3 -sticky ew
568574
grid .nameC -row 1 -column 5 -sticky ew
569575
grid .nameD -row 1 -column 7 -sticky ew
@@ -571,9 +577,11 @@
571577
grid .sby -row 2 -column 8 -sticky ns
572578
grid .sbxA -row 3 -column 1 -sticky ew
573579
grid .sbxB -row 3 -column 3 -sticky ew
574580
grid .sbxC -row 3 -column 5 -sticky ew
575581
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
577585
578586
.spacer config -height [winfo height .sbxA]
579587
wm deiconify .
580588
--- 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

Keyboard Shortcuts

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