Skip to content

Commit 7754656

Browse files
committed
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 <[email protected]>
1 parent 8ccb2d4 commit 7754656

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

gitk

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11934,21 +11934,6 @@ proc setselbg {c} {
1193411934
allcanvs itemconf secsel -fill $c
1193511935
}
1193611936
11937-
# This sets the background color and the color scheme for the whole UI.
11938-
# For some reason, tk_setPalette chooses a nasty dark red for selectColor
11939-
# if we don't specify one ourselves, which makes the checkbuttons and
11940-
# radiobuttons look bad. This chooses white for selectColor if the
11941-
# background color is light, or black if it is dark.
11942-
proc setui {c} {
11943-
if {[tk windowingsystem] eq "win32"} { return }
11944-
set bg [winfo rgb . $c]
11945-
set selc black
11946-
if {[lindex $bg 0] + 1.5 * [lindex $bg 1] + 0.5 * [lindex $bg 2] > 100000} {
11947-
set selc white
11948-
}
11949-
tk_setPalette background $c selectColor $selc
11950-
}
11951-
1195211937
proc setbg {c} {
1195311938
global bglist
1195411939
@@ -11976,7 +11961,6 @@ proc set_gui_colors {} {
1197611961
global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
1197711962
global diffbgcolors
1197811963
11979-
setui $uicolor
1198011964
setbg $bgcolor
1198111965
setfg $fgcolor
1198211966
$ctext tag conf d0 -foreground [lindex $diffcolors 0]

0 commit comments

Comments
 (0)