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

git-gui: if a background colour is set, set foreground colour as well

In several places, only the background colour is set to an explicit value, sometimes even "white". This does not work well with dark colour themes. This patch tries to set the foreground colour to "black" in those situations, where an explicit background colour is set without defining any foreground colour. Signed-off-by: Philipp A. Hartmann <ph@sorgh.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Philipp A. Hartmann committed Mar 5, 2008 at 17:54 UTC c382fdd79548a56fadf8f34d3484cf020eda3966
6 files changed +47 -16
git-gui.sh
+13 -6
@@ -2289,8 +2289,9 @@ pack .vpane -anchor n -side top -fill both -expand 1
2289 #
2290 frame .vpane.files.index -height 100 -width 200
2291 label .vpane.files.index.title -text [mc "Staged Changes (Will Commit)"] \
2292 - -background lightgreen
2293 -text $ui_index -background white -borderwidth 0 \
2292 + -background lightgreen -foreground black
2293 +text $ui_index -background white -foreground black \
2294 + -borderwidth 0 \
2295 -width 20 -height 10 \
2296 -wrap none \
2297 -cursor $cursor_ptr \
@@ -2308,8 +2309,9 @@ pack $ui_index -side left -fill both -expand 1
2309 #
2310 frame .vpane.files.workdir -height 100 -width 200
2311 label .vpane.files.workdir.title -text [mc "Unstaged Changes"] \
2311 - -background lightsalmon
2312 -text $ui_workdir -background white -borderwidth 0 \
2312 + -background lightsalmon -foreground black
2313 +text $ui_workdir -background white -foreground black \
2314 + -borderwidth 0 \
2315 -width 20 -height 10 \
2316 -wrap none \
2317 -cursor $cursor_ptr \
@@ -2416,7 +2418,8 @@ pack $ui_coml -side left -fill x
2418 pack .vpane.lower.commarea.buffer.header.amend -side right
2419 pack .vpane.lower.commarea.buffer.header.new -side right
2420
2419 -text $ui_comm -background white -borderwidth 1 \
2421 +text $ui_comm -background white -foreground black \
2422 + -borderwidth 1 \
2423 -undo true \
2424 -maxundo 20 \
2425 -autoseparators true \
@@ -2493,15 +2496,18 @@ trace add variable current_diff_path write trace_current_diff_path
2496 frame .vpane.lower.diff.header -background gold
2497 label .vpane.lower.diff.header.status \
2498 -background gold \
2499 + -foreground black \
2500 -width $max_status_desc \
2501 -anchor w \
2502 -justify left
2503 label .vpane.lower.diff.header.file \
2504 -background gold \
2505 + -foreground black \
2506 -anchor w \
2507 -justify left
2508 label .vpane.lower.diff.header.path \
2509 -background gold \
2510 + -foreground black \
2511 -anchor w \
2512 -justify left
2513 pack .vpane.lower.diff.header.status -side left
@@ -2525,7 +2531,8 @@ bind_button3 .vpane.lower.diff.header.path "tk_popup $ctxm %X %Y"
2531 #
2532 frame .vpane.lower.diff.body
2533 set ui_diff .vpane.lower.diff.body.t
2528 -text $ui_diff -background white -borderwidth 0 \
2534 +text $ui_diff -background white -foreground black \
2535 + -borderwidth 0 \
2536 -width 80 -height 15 -wrap none \
2537 -font font_diff \
2538 -xscrollcommand {.vpane.lower.diff.body.sbx set} \
lib/blame.tcl
+20 -5
@@ -80,6 +80,7 @@ constructor new {i_commit i_path} {
80 label $w.header.commit_l \
81 -text [mc "Commit:"] \
82 -background gold \
83 + -foreground black \
84 -anchor w \
85 -justify left
86 set w_back $w.header.commit_b
@@ -89,6 +90,7 @@ constructor new {i_commit i_path} {
90 -relief flat \
91 -state disabled \
92 -background gold \
93 + -foreground black \
94 -activebackground gold
95 bind $w_back <Button-1> "
96 if {\[$w_back cget -state\] eq {normal}} {
@@ -98,16 +100,19 @@ constructor new {i_commit i_path} {
100 label $w.header.commit \
101 -textvariable @commit \
102 -background gold \
103 + -foreground black \
104 -anchor w \
105 -justify left
106 label $w.header.path_l \
107 -text [mc "File:"] \
108 -background gold \
109 + -foreground black \
110 -anchor w \
111 -justify left
112 set w_path $w.header.path
113 label $w_path \
114 -background gold \
115 + -foreground black \
116 -anchor w \
117 -justify left
118 pack $w.header.commit_l -side left
@@ -135,7 +140,9 @@ constructor new {i_commit i_path} {
140 -takefocus 0 \
141 -highlightthickness 0 \
142 -padx 0 -pady 0 \
138 - -background white -borderwidth 0 \
143 + -background white \
144 + -foreground black \
145 + -borderwidth 0 \
146 -state disabled \
147 -wrap none \
148 -height 40 \
@@ -148,7 +155,9 @@ constructor new {i_commit i_path} {
155 -takefocus 0 \
156 -highlightthickness 0 \
157 -padx 0 -pady 0 \
151 - -background white -borderwidth 0 \
158 + -background white \
159 + -foreground black \
160 + -borderwidth 0 \
161 -state disabled \
162 -wrap none \
163 -height 40 \
@@ -166,7 +175,9 @@ constructor new {i_commit i_path} {
175 -takefocus 0 \
176 -highlightthickness 0 \
177 -padx 0 -pady 0 \
169 - -background white -borderwidth 0 \
178 + -background white \
179 + -foreground black \
180 + -borderwidth 0 \
181 -state disabled \
182 -wrap none \
183 -height 40 \
@@ -184,7 +195,9 @@ constructor new {i_commit i_path} {
195 -takefocus 0 \
196 -highlightthickness 0 \
197 -padx 0 -pady 0 \
187 - -background white -borderwidth 0 \
198 + -background white \
199 + -foreground black \
200 + -borderwidth 0 \
201 -state disabled \
202 -wrap none \
203 -height 40 \
@@ -213,7 +226,9 @@ constructor new {i_commit i_path} {
226
227 set w_cviewer $w.file_pane.cm.t
228 text $w_cviewer \
216 - -background white -borderwidth 0 \
229 + -background white \
230 + -foreground black \
231 + -borderwidth 0 \
232 -state disabled \
233 -wrap none \
234 -height 10 \
lib/browser.tcl
+2 -1
@@ -39,7 +39,8 @@ constructor new {commit {path {}}} {
39
40 frame $w.list
41 set w_list $w.list.l
42 - text $w_list -background white -borderwidth 0 \
42 + text $w_list -background white -foreground black \
43 + -borderwidth 0 \
44 -cursor $cursor_ptr \
45 -state disabled \
46 -wrap none \
lib/choose_font.tcl
+2
@@ -55,6 +55,7 @@ constructor pick {path title a_family a_size} {
55 set w_family $w.inner.family.v
56 text $w_family \
57 -background white \
58 + -foreground black \
59 -borderwidth 1 \
60 -relief sunken \
61 -cursor $::cursor_ptr \
@@ -92,6 +93,7 @@ constructor pick {path title a_family a_size} {
93 set w_example $w.example.t
94 text $w_example \
95 -background white \
96 + -foreground black \
97 -borderwidth 1 \
98 -relief sunken \
99 -height 3 \
lib/console.tcl
+7 -3
@@ -46,7 +46,9 @@ method _init {} {
46 -justify left \
47 -font font_uibold
48 text $w_t \
49 - -background white -borderwidth 1 \
49 + -background white \
50 + -foreground black \
51 + -borderwidth 1 \
52 -relief sunken \
53 -width 80 -height 10 \
54 -wrap none \
@@ -180,7 +182,8 @@ method done {ok} {
182 if {$ok} {
183 if {[winfo exists $w.m.s]} {
184 bind $w.m.s <Destroy> [list delete_this $this]
183 - $w.m.s conf -background green -text [mc "Success"]
185 + $w.m.s conf -background green -foreground black \
186 + -text [mc "Success"]
187 if {$is_toplevel} {
188 $w.ok conf -state normal
189 focus $w.ok
@@ -193,7 +196,8 @@ method done {ok} {
196 _init $this
197 }
198 bind $w.m.s <Destroy> [list delete_this $this]
196 - $w.m.s conf -background red -text [mc "Error: Command Failed"]
199 + $w.m.s conf -background red -foreground black \
200 + -text [mc "Error: Command Failed"]
201 if {$is_toplevel} {
202 $w.ok conf -state normal
203 focus $w.ok
lib/error.tcl
+3 -1
@@ -80,7 +80,9 @@ proc hook_failed_popup {hook msg {is_fatal 1}} {
80 -justify left \
81 -font font_uibold
82 text $w.m.t \
83 - -background white -borderwidth 1 \
83 + -background white \
84 + -foreground black \
85 + -borderwidth 1 \
86 -relief sunken \
87 -width 80 -height 10 \
88 -font font_diff \