gitk: support link color in the Preferences dialog

As a dark-theme user, I use the Preferences dialog to set colors for gitk. The only color I cannot change via that dialog is the link foreground color, which leads to using the default link color on a dark background that makes it hard to read. Make the link foreground color also configurable in the Gitk Preferences dialog's Color tab, so users won't need to dig into the code/manual to check if it is configurable and can simply set the color there. Signed-off-by: Wang Zichong <wangzichong@deepin.org> Signed-off-by: Johannes Sixt <j6t@kdbg.org>

Wang Zichong committed Feb 28, 2026 at 07:59 UTC de4201af7d57b2da6981884e969fe1e6d327108c
1 file changed +8 -2
gitk
+8 -2
@@ -11796,7 +11796,7 @@ proc prefspage_general {notebook} {
11796
11797 proc prefspage_colors {notebook} {
11798 global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
11799 - global diffbgcolors
11799 + global diffbgcolors linkfgcolor
11800 global themeloader
11801
11802 set page [create_prefs_page $notebook.colors]
@@ -11873,6 +11873,11 @@ proc prefspage_colors {notebook} {
11873 -command [list choosecolor selectbgcolor {} $page [mc "background"]]
11874 grid x $page.selbgbut $page.selbgsep -sticky w
11875
11876 + label $page.linkfg -padx 40 -relief sunk -background $linkfgcolor
11877 + ttk::button $page.linkfgbut -text [mc "Link"] \
11878 + -command [list choosecolor linkfgcolor {} $page [mc "link"]]
11879 + grid x $page.linkfgbut $page.linkfg -sticky w
11880 +
11881 grid columnconfigure $page 2 -weight 1
11882
11883 return $page
@@ -11880,7 +11885,7 @@ proc prefspage_colors {notebook} {
11885
11886 proc prefspage_set_colorswatches {page} {
11887 global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
11883 - global diffbgcolors
11888 + global diffbgcolors linkfgcolor
11889
11890 $page.bg configure -background $bgcolor
11891 $page.fg configure -background $fgcolor
@@ -11891,6 +11896,7 @@ proc prefspage_set_colorswatches {page} {
11896 $page.hunksep configure -background [lindex $diffcolors 2]
11897 $page.markbgsep configure -background $markbgcolor
11898 $page.selbgsep configure -background $selectbgcolor
11899 + $page.linkfg configure -background $linkfgcolor
11900 }
11901
11902 proc prefspage_fonts {notebook} {