git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 18:06 UTC

[PATCH v2 3/6] gitk: show color preferences on the button instead of the label

From
Johannes Sixt via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 12, 2026, 13:16 UTC
Message-ID
<75202a52d7912e67f6b92662f5349127c26c70b7.1786540582.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.2194.v2.git.1786540582.gitgitgadget@gmail.com>
From: Johannes Sixt <j6t@kdbg.org>

When the user goes to the color preferences, the eye is automatically drawn to the color samples. However, clicking on the sample with the intent to change it does nothing. Instead, the text label also acts as a button and must be clicked to change the color.

Turn the color samples into clickable buttons and the text labels into static text. Use non-themed buttons because their color can be changed by simply specifying the color properties. (Themed buttons would need a lot more elaboration.)

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 gitk-git/gitk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 137940defb..afc7c2d39d 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -11867,10 +11867,10 @@ proc prefspage_colors {notebook} {
     ]
 
     foreach {uielem colorvar idx label title} $coloruielems {
-        label $page.$uielem -padx 40 -relief sunk
-        ttk::button $page.${uielem}btn -text $label \
+        ttk::label $page.$uielem -text $label
+        button $page.${uielem}btn -padx 40 -pady 0 -borderwidth 2 \
             -command [list choosecolor $colorvar $idx $page $title]
-        grid x $page.${uielem}btn $page.$uielem -sticky w
+        grid x $page.$uielem $page.${uielem}btn -sticky w -pady 1
     }
 
     grid columnconfigure $page 2 -weight 1
@@ -11896,7 +11896,7 @@ proc prefspage_set_colorswatches {page} {
         linkfg    $linkfgcolor \
     ]
     foreach {uielem color} $coloruielems {
-        $page.$uielem configure -background $color
+        $page.${uielem}btn configure -background $color -activebackground $color
     }
 }
 
-- 
gitgitgadget
Previous: Johannes Sixt via GitGitGadgetNext: Johannes Sixt via GitGitGadget
Message 20 of 27 in “gitk: make color preferences visually more pleasing and better usable”
  1. 0/5 gitk: make color preferences visually more pleasing and better usableJohannes Sixt via GitGitGadget, Aug 6, 2026
  2. 1/5 gitk: set intitial colors of swatches using the available helperJohannes Sixt via GitGitGadget, Aug 6, 2026
  3. 2/5 gitk: condense repetitive code around color buttons into foreach loopsJohannes Sixt via GitGitGadget, Aug 6, 2026
  4. 3/5 gitk: show color preferences on the button instead of the labelJohannes Sixt via GitGitGadget, Aug 6, 2026
  5. 4/5 gitk: use more natural language for labels of color preferencesJohannes Sixt via GitGitGadget, Aug 6, 2026
  6. 5/5 gitk: avoid constructing dialog titles from text piecesJohannes Sixt via GitGitGadget, Aug 6, 2026
  7. markAug 7, 2026
  8. markAug 7, 2026
  9. markAug 7, 2026
  10. markAug 7, 2026
  11. Johannes SixtAug 8, 2026
  12. Johannes SixtAug 8, 2026
  13. Mark LevedahlAug 8, 2026
  14. Junio C HamanoAug 8, 2026
  15. Johannes SixtAug 9, 2026
  16. Johannes SixtAug 9, 2026
  17. 0/6 gitk: make color preferences visually more pleasing and better usableJohannes Sixt via GitGitGadget, Aug 12, 2026
  18. 1/6 gitk: set intitial colors of swatches using the available helperJohannes Sixt via GitGitGadget, Aug 12, 2026
  19. 2/6 gitk: condense repetitive code around color buttons into foreach loopsJohannes Sixt via GitGitGadget, Aug 12, 2026
  20. 3/6 gitk: show color preferences on the button instead of the labelJohannes Sixt via GitGitGadget, Aug 12, 2026
  21. 4/6 gitk: use more natural language for labels of color preferencesJohannes Sixt via GitGitGadget, Aug 12, 2026
  22. 5/6 gitk: avoid constructing dialog titles from text piecesJohannes Sixt via GitGitGadget, Aug 12, 2026
  23. 6/6 gitk: move UI for generic colors above diff colorsJohannes Sixt via GitGitGadget, Aug 12, 2026
  24. Mark LevedahlAug 13, 2026
  25. Mark LevedahlAug 13, 2026
  26. Johannes SixtAug 13, 2026
  27. Mark LevedahlAug 13, 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.