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

git-gui: Make diff viewer colors match gitk's defaults.

Because users who use git-gui are likely to also be using gitk, we should at least match gitk's default colors and formatting within the diff viewer. Unfortunately this meant that I needed to change the background colors of the hunks in a 'diff --cc' output, as the green used for 'added line' was completely unreadable on the old color. We now use ivory1 to show hunks which came from HEAD/parent^1, which are the portions that the current branch has contributed, and are probably the user's own changes. We use a very light blue for the portions which came from FETCH_HEAD, as this makes the changes made by the other branch stand out more in the diff. I've also modified the hunk header lines to be blue, as that is how gitk is showing them. Apparently I forgot to raise the sel tag above everything else in the diff viewer, which meant that selections in the diff viewer were not visible if they were made on a 'diff --cc' hunk which had a background. Its now the higest priority tag, ensuring the selection is always visible and readable. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Jan 21, 2007 at 14:49 UTC ca52156618ce374711e37c8d633f0ee30cdd58c3
1 file changed +11 -9
git-gui.sh
+11 -9
@@ -3916,24 +3916,24 @@ pack $ui_diff -side left -fill both -expand 1
3916 pack .vpane.lower.diff.header -side top -fill x
3917 pack .vpane.lower.diff.body -side bottom -fill both -expand 1
3918
3919 -$ui_diff tag conf d_@ -font font_diffbold
3920 -$ui_diff tag conf d_+ -foreground blue
3919 +$ui_diff tag conf d_@ -foreground blue -font font_diffbold
3920 +$ui_diff tag conf d_+ -foreground {#00a000}
3921 $ui_diff tag conf d_- -foreground red
3922
3923 -$ui_diff tag conf d_++ -foreground blue
3923 +$ui_diff tag conf d_++ -foreground {#00a000}
3924 $ui_diff tag conf d_-- -foreground red
3925 $ui_diff tag conf d_+s \
3926 - -foreground blue \
3927 - -background azure2
3926 + -foreground {#00a000} \
3927 + -background {#e2effa}
3928 $ui_diff tag conf d_-s \
3929 -foreground red \
3930 - -background azure2
3930 + -background {#e2effa}
3931 $ui_diff tag conf d_s+ \
3932 - -foreground blue \
3933 - -background {light goldenrod yellow}
3932 + -foreground {#00a000} \
3933 + -background ivory1
3934 $ui_diff tag conf d_s- \
3935 -foreground red \
3936 - -background {light goldenrod yellow}
3936 + -background ivory1
3937
3938 $ui_diff tag conf d<<<<<<< \
3939 -foreground orange \
@@ -3945,6 +3945,8 @@ $ui_diff tag conf d>>>>>>> \
3945 -foreground orange \
3946 -font font_diffbold
3947
3948 +$ui_diff tag raise sel
3949 +
3950 # -- Diff Body Context Menu
3951 #
3952 set ctxm .vpane.lower.diff.body.ctxm