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>
This commit is contained in:
Philipp A. Hartmann
2008-03-05 17:54:22 +01:00
committed by Shawn O. Pearce
parent 312fd92b06
commit c382fdd795
6 changed files with 47 additions and 16 deletions

View File

@ -46,7 +46,9 @@ method _init {} {
-justify left \
-font font_uibold
text $w_t \
-background white -borderwidth 1 \
-background white \
-foreground black \
-borderwidth 1 \
-relief sunken \
-width 80 -height 10 \
-wrap none \
@ -180,7 +182,8 @@ method done {ok} {
if {$ok} {
if {[winfo exists $w.m.s]} {
bind $w.m.s <Destroy> [list delete_this $this]
$w.m.s conf -background green -text [mc "Success"]
$w.m.s conf -background green -foreground black \
-text [mc "Success"]
if {$is_toplevel} {
$w.ok conf -state normal
focus $w.ok
@ -193,7 +196,8 @@ method done {ok} {
_init $this
}
bind $w.m.s <Destroy> [list delete_this $this]
$w.m.s conf -background red -text [mc "Error: Command Failed"]
$w.m.s conf -background red -foreground black \
-text [mc "Error: Command Failed"]
if {$is_toplevel} {
$w.ok conf -state normal
focus $w.ok