gitk: do not invoke tk_setPalette
gitk uses themed widgets with a user selected theme, but also invokes tk_setPalette to configure colors for the non-themed widgets including the menubar. However, themes in general are expected to configure those colors already. The builtin themes (default, alt, clam, classic on unix/X11) all have compatible colors, and need no such reconfiguration, and (most, if not all) available themes set the options database for this purpose as well. Furthermore, gitk in the past avoided invoking tk_setPalette on Windows to avoid some issues. So, let's stop calling tk_setPalette everywhere, and just rely upon the selected theme (possibly user installed) to have set all needed colors. Note: if a user installs more than one theme using $themeloader, the last one installed will have defined the colors to be used. Those colors will probably be incorrect for any other set, including Tk's builtin set. Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>main^2^2
parent
8ccb2d4a76
commit
7754656a4c
16
gitk
16
gitk
|
@ -11934,21 +11934,6 @@ proc setselbg {c} {
|
|||
allcanvs itemconf secsel -fill $c
|
||||
}
|
||||
|
||||
# This sets the background color and the color scheme for the whole UI.
|
||||
# For some reason, tk_setPalette chooses a nasty dark red for selectColor
|
||||
# if we don't specify one ourselves, which makes the checkbuttons and
|
||||
# radiobuttons look bad. This chooses white for selectColor if the
|
||||
# background color is light, or black if it is dark.
|
||||
proc setui {c} {
|
||||
if {[tk windowingsystem] eq "win32"} { return }
|
||||
set bg [winfo rgb . $c]
|
||||
set selc black
|
||||
if {[lindex $bg 0] + 1.5 * [lindex $bg 1] + 0.5 * [lindex $bg 2] > 100000} {
|
||||
set selc white
|
||||
}
|
||||
tk_setPalette background $c selectColor $selc
|
||||
}
|
||||
|
||||
proc setbg {c} {
|
||||
global bglist
|
||||
|
||||
|
@ -11976,7 +11961,6 @@ proc set_gui_colors {} {
|
|||
global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
|
||||
global diffbgcolors
|
||||
|
||||
setui $uicolor
|
||||
setbg $bgcolor
|
||||
setfg $fgcolor
|
||||
$ctext tag conf d0 -foreground [lindex $diffcolors 0]
|
||||
|
|
Loading…
Reference in New Issue