git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3] gitk: support link color in the Preferences dialog

From
GGGary Wang via GitGitGadget <gitgitgadget@gmail.com>
Date
Feb 28, 2026, 07:59 UTC
Message-ID
<pull.2217.v3.git.git.1772265584806.gitgitgadget@gmail.com>
In-Reply-To
<pull.2217.v2.git.git.1772251558434.gitgitgadget@gmail.com>
From: Wang Zichong <wangzichong@deepin.org>

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>
---
    gitk: support config the color of linkfgcolor via Gitk Preferences
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2217%2FBLumia%2Fgitk-linkfgcolor-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2217/BLumia/gitk-linkfgcolor-v3
Pull-Request: https://github.com/git/git/pull/2217
Range-diff vs v2:
 1:  f533af7ac5 ! 1:  a2be1c0441 gitk: support link color in the Preferences dialog
     @@ Commit message
          the code/manual to check if it is configurable and can simply set
          the color there.
      
     -    CC: Mark Levedahl <mlevedahl@gmail.com>
     -    CC: Paul Mackerras <paulus@samba.org>
     -    CC: Johannes Sixt <j6t@kdbg.org>
          Signed-off-by: Wang Zichong <wangzichong@deepin.org>
          ---
     -    Changelog (v2):
     +    Changelog (v3):
      
     -      * reword commit message as suggesed by Johannes
     -      * Rename button text from "link color" to "link" as suggested
     -        by Johannes
     +      * Remove CC list from commit message as suggested by Hannes
      
       ## gitk-git/gitk ##
      @@ gitk-git/gitk: proc prefspage_general {notebook} {
Changelog (v3):
  * Remove CC list from commit message as suggested by Hannes
---
 gitk-git/gitk | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index cbaaee994e..1c289174d5 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -11796,7 +11796,7 @@ proc prefspage_general {notebook} {
 
 proc prefspage_colors {notebook} {
     global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
-    global diffbgcolors
+    global diffbgcolors linkfgcolor
     global themeloader
 
     set page [create_prefs_page $notebook.colors]
@@ -11873,6 +11873,11 @@ proc prefspage_colors {notebook} {
         -command [list choosecolor selectbgcolor {} $page [mc "background"]]
     grid x $page.selbgbut $page.selbgsep -sticky w
 
+    label $page.linkfg -padx 40 -relief sunk -background $linkfgcolor
+    ttk::button $page.linkfgbut -text [mc "Link"] \
+        -command [list choosecolor linkfgcolor {} $page [mc "link"]]
+    grid x $page.linkfgbut $page.linkfg -sticky w
+
     grid columnconfigure $page 2 -weight 1
 
     return $page
@@ -11880,7 +11885,7 @@ proc prefspage_colors {notebook} {
 
 proc prefspage_set_colorswatches {page} {
     global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
-    global diffbgcolors
+    global diffbgcolors linkfgcolor
 
     $page.bg configure -background $bgcolor
     $page.fg configure -background $fgcolor
@@ -11891,6 +11896,7 @@ proc prefspage_set_colorswatches {page} {
     $page.hunksep configure -background [lindex $diffcolors 2]
     $page.markbgsep configure -background $markbgcolor
     $page.selbgsep configure -background $selectbgcolor
+    $page.linkfg configure -background $linkfgcolor
 }
 
 proc prefspage_fonts {notebook} {

base-commit: 7b2bccb0d58d4f24705bf985de1f4612e4cf06e5
-- 
gitgitgadget
Previous: Gary Wang via GitGitGadgetNext: Johannes Sixt
Message 9 of 10 in “gitk: support config the color of linkfgcolor via Gitk Preferences”
  1. gitk: support config the color of linkfgcolor via Gitk PreferencesGary Wang via GitGitGadget, Feb 26, 2026
  2. Junio C HamanoFeb 26, 2026
  3. Johannes SixtFeb 27, 2026
  4. Junio C HamanoFeb 27, 2026
  5. Wang ZichongFeb 28, 2026
  6. Johannes SixtFeb 28, 2026
  7. Wang ZichongFeb 28, 2026
  8. gitk: support link color in the Preferences dialogGary Wang via GitGitGadget, Feb 28, 2026
  9. gitk: support link color in the Preferences dialogGary Wang via GitGitGadget, Feb 28, 2026
  10. Johannes SixtMar 1, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.