@matheusbsbs / matheus-bagliano / commits / e3e901bece
Fork 0

gitk: Make the background color of marked lines configurable

This makes it possible for the user to configure the background color of lines that are "marked". At the moment only the "show the origin of this line" function marks lines. This also makes the user's choice persistent by saving it in ~/.gitk. Signed-off-by: Paul Mackerras <paulus@samba.org>

Paul Mackerras committed Oct 27, 2008 at 22:37 UTC e3e901bece93417392faa3dd7833d69271cf74f6
1 file changed +12 -4
gitk
+12 -4
@@ -2415,7 +2415,7 @@ proc savestuff {w} {
2415 global viewname viewfiles viewargs viewargscmd viewperm nextviewnum
2416 global cmitmode wrapcomment datetimeformat limitdiffs
2417 global colors bgcolor fgcolor diffcolors diffcontext selectbgcolor
2418 - global autoselect extdifftool perfile_attrs
2418 + global autoselect extdifftool perfile_attrs markbgcolor
2419
2420 if {$stuffsaved} return
2421 if {![winfo viewable .]} return
@@ -2439,6 +2439,7 @@ proc savestuff {w} {
2439 puts $f [list set fgcolor $fgcolor]
2440 puts $f [list set colors $colors]
2441 puts $f [list set diffcolors $diffcolors]
2442 + puts $f [list set markbgcolor $markbgcolor]
2443 puts $f [list set diffcontext $diffcontext]
2444 puts $f [list set selectbgcolor $selectbgcolor]
2445 puts $f [list set extdifftool $extdifftool]
@@ -6658,11 +6659,11 @@ proc getblobline {bf id} {
6659 }
6660
6661 proc mark_ctext_line {lnum} {
6661 - global ctext
6662 + global ctext markbgcolor
6663
6664 $ctext tag delete omark
6665 $ctext tag add omark $lnum.0 "$lnum.0 + 1 line"
6665 - $ctext tag conf omark -background "#e0e0ff"
6666 + $ctext tag conf omark -background $markbgcolor
6667 $ctext see $lnum.0
6668 }
6669
@@ -9731,7 +9732,7 @@ proc chg_fontparam {v sub op} {
9732 proc doprefs {} {
9733 global maxwidth maxgraphpct
9734 global oldprefs prefstop showneartags showlocalchanges
9734 - global bgcolor fgcolor ctext diffcolors selectbgcolor
9735 + global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
9736 global tabstop limitdiffs autoselect extdifftool perfile_attrs
9737
9738 set top .gitkprefs
@@ -9824,6 +9825,12 @@ proc doprefs {} {
9825 "diff hunk header" \
9826 [list $ctext tag conf hunksep -foreground]]
9827 grid x $top.hunksepbut $top.hunksep -sticky w
9828 + label $top.markbgsep -padx 40 -relief sunk -background $markbgcolor
9829 + button $top.markbgbut -text [mc "Marked line bg"] -font optionfont \
9830 + -command [list choosecolor markbgcolor {} $top.markbgsep \
9831 + [mc "marked line background"] \
9832 + [list $ctext tag conf omark -background]]
9833 + grid x $top.markbgbut $top.markbgsep -sticky w
9834 label $top.selbgsep -padx 40 -relief sunk -background $selectbgcolor
9835 button $top.selbgbut -text [mc "Select bg"] -font optionfont \
9836 -command [list choosecolor selectbgcolor {} $top.selbgsep background setselbg]
@@ -10369,6 +10376,7 @@ set diffcolors {red "#00a000" blue}
10376 set diffcontext 3
10377 set ignorespace 0
10378 set selectbgcolor gray85
10379 +set markbgcolor "#e0e0ff"
10380
10381 set circlecolors {white blue gray blue blue}
10382