Commit

8cb535f6cc71ca10c798f89263e847afa432734a

gitk: show color preferences on the button instead of the label

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>

Johannes Sixt <j6t@kdbg.org> · 2026-08-03 20:28 UTC

Browse files
1 file changed, +4 −4
modified gitk
@@ -11867,10 +11867,10 @@ proc prefspage_colors {notebook} {
11867 11867 ]
11868 11868
11869 11869 foreach {uielem colorvar idx label title} $coloruielems {
11870 - label $page.$uielem -padx 40 -relief sunk
11871 - ttk::button $page.${uielem}btn -text $label \
11870 + ttk::label $page.$uielem -text $label
11871 + button $page.${uielem}btn -padx 40 -pady 0 -borderwidth 2 \
11872 11872 -command [list choosecolor $colorvar $idx $page $title]
11873 - grid x $page.${uielem}btn $page.$uielem -sticky w
11873 + grid x $page.$uielem $page.${uielem}btn -sticky w -pady 1
11874 11874 }
11875 11875
11876 11876 grid columnconfigure $page 2 -weight 1
@@ -11896,7 +11896,7 @@ proc prefspage_set_colorswatches {page} {
11896 11896 linkfg $linkfgcolor \
11897 11897 ]
11898 11898 foreach {uielem color} $coloruielems {
11899 - $page.$uielem configure -background $color
11899 + $page.${uielem}btn configure -background $color -activebackground $color
11900 11900 }
11901 11901 }
11902 11902