git-gui: Highlight the blame commit header from everything else
The selected commit's blame header is now drawn in green, using the same background color that is shown in the main file content viewer. The result is a much better looking commit pane, as we use bold for header "keys" and proportional width fonts for the stuff that doesn't need to be fixed width to maintain its formatting. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Jun 1, 2007 at 03:19 UTC
74fe89857807c2194b1c202b4e429289d777ecb2
1 file changed
+23
-5
lib/blame.tcl
+23
-5
@@ -43,6 +43,7 @@ variable group_colors {
43
}
44
45
constructor new {i_commit i_path} {
46
+ variable active_color
47
global cursor_ptr
48
49
set commit $i_commit
@@ -139,6 +140,14 @@ constructor new {i_commit i_path} {
140
-xscrollcommand [list $w.cm.sbx set] \
141
-yscrollcommand [list $w.cm.sby set] \
142
-font font_diff
143
+ $w_cmit tag conf header_key \
144
+ -tabs {3c} \
145
+ -background $active_color \
146
+ -font font_uibold
147
+ $w_cmit tag conf header_val \
148
+ -background $active_color \
149
+ -font font_ui
150
+ $w_cmit tag raise sel
151
scrollbar $w.cm.sbx -orient h -command [list $w_cmit xview]
152
scrollbar $w.cm.sby -orient v -command [list $w_cmit yview]
153
pack $w.cm.sby -side right -fill y
@@ -449,12 +458,21 @@ method _showcommit {lno} {
458
set header($cmit,message) $msg
459
}
460
452
- $w_cmit insert end "commit $cmit
453
-Author: $author_name $author_email $author_time
454
-Committer: $committer_name $committer_email $committer_time
455
-Original File: [escape_path $line_file($lno)]
461
+ $w_cmit insert end "commit $cmit\n" header_key
462
+ $w_cmit insert end "Author:\t" header_key
463
+ $w_cmit insert end "$author_name $author_email" header_val
464
+ $w_cmit insert end "$author_time\n" header_val
465
+
466
+ $w_cmit insert end "Committer:\t" header_key
467
+ $w_cmit insert end "$committer_name $committer_email" header_val
468
+ $w_cmit insert end "$committer_time\n" header_val
469
+
470
+ if {$line_file($lno) ne $path} {
471
+ $w_cmit insert end "Original File:\t" header_key
472
+ $w_cmit insert end "[escape_path $line_file($lno)]\n" header_val
473
+ }
474
457
-$msg"
475
+ $w_cmit insert end "\n$msg"
476
}
477
$w_cmit conf -state disabled
478