All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Johannes Sixt via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: mark <mlevedahl@gmail.com>, Johannes Sixt <j6t@kdbg.org>
Subject: [PATCH v2 0/6] gitk: make color preferences visually more pleasing and better usable
Date: Wed, 12 Aug 2026 13:16:15 +0000	[thread overview]
Message-ID: <pull.2194.v2.git.1786540582.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.2194.git.1785998419.gitgitgadget@gmail.com>

I find the user interface to set the color preferences a bit ugly for these
reasons:

 * The color samples are not clickable as one would expect who enters the
   dialog. Instead, the description is the button that must be clicked.

 * Since the descriptive texts are different for the preferences, the width
   of the buttons are different, too.

 * The descriptions themselves are not always natural language (read: they
   are nerdy) and use abbreviations.

This series makes the descriptions static text and turns the color samples
into the clickable buttons. It also makes the descriptions and dialog titles
more natural language.

Changes since v1:

 * Apply a thicker border to the buttons and some vertical distance between
   the lines.
 * Remove "Diff" from the labels, because they are sufficiently unambiguous
   without.
 * Fine-tune the wording of the labels for better English.
 * Move selection and link colors above diff colors.
 * Tweak the commit messages.

This is the dialog before the change: Screenshot_color_buttons_before
[https://github.com/user-attachments/assets/910a647f-4e56-47b0-b4c4-e6e7bc966e9c]
And this is the dialog after the change: Screenshot_color_buttons_after_v2
[https://github.com/user-attachments/assets/9c0fae28-727a-4bdd-9d76-36e276217322]

Johannes Sixt (6):
  gitk: set intitial colors of swatches using the available helper
  gitk: condense repetitive code around color buttons into foreach loops
  gitk: show color preferences on the button instead of the label
  gitk: use more natural language for labels of color preferences
  gitk: avoid constructing dialog titles from text pieces
  gitk: move UI for generic colors above diff colors

 gitk-git/gitk | 123 ++++++++++++++++++++++++--------------------------
 1 file changed, 59 insertions(+), 64 deletions(-)


base-commit: a97fcc37c2bc6340a8d7ce78dedf227aac4e9aa7
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2194%2Fj6t%2Fgitk-prefs-color-buttons-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2194/j6t/gitk-prefs-color-buttons-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/2194

Range-diff vs v1:

 1:  ab16ec6276 ! 1:  e7e62f428b gitk: set intitial colors of swatches using the available helper
     @@ Commit message
          gitk: set intitial colors of swatches using the available helper
      
          After the user has selected a color in the Preferences dialog, the
     -    helper proc prefspage_set_colorswatches is used update the colors shown
     -    in the Preferences dialog. Use this proc also after the Preferences
     -    dialog is constructed to show the initial colors. This keeps the
     +    helper proc prefspage_set_colorswatches is used to update the colors
     +    shown in the Preferences dialog. Use this proc also to show the initial
     +    colors after the Preferences dialog is constructed. This keeps the
          procedure that gives the UI elements their colors in a single place.
      
          Signed-off-by: Johannes Sixt <j6t@kdbg.org>
 2:  edb567608e = 2:  52dacc4924 gitk: condense repetitive code around color buttons into foreach loops
 3:  0428a92efc ! 3:  75202a52d7 gitk: show color preferences on the button instead of the label
     @@ gitk-git/gitk: proc prefspage_colors {notebook} {
      -        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 \
     ++        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
     ++        grid x $page.$uielem $page.${uielem}btn -sticky w -pady 1
           }
       
           grid columnconfigure $page 2 -weight 1
 4:  ce417701a8 ! 4:  45d5b05281 gitk: use more natural language for labels of color preferences
     @@ Commit message
          gitk: use more natural language for labels of color preferences
      
          The labels used to be clickable buttons. These would have looked funny
     -    if they carried long texts. For this reason, abbreviations and "nerdy"
     -    texts were used to keep them short. Since these labels are now static
     -    text, bring them closer to natural language.
     +    if they carried long texts. For this reason, jargon and abbreviations
     +    were used to keep them short. Since there is no button frame around the
     +    labels anymore, the texts can become longer without becoming ugly.
     +    Bring them closer to natural language.
     +
     +    Remove the prefix "Diff" from labels, because the remaining texts are
     +    sufficiently unambiguous that they are about diff text.
      
          Signed-off-by: Johannes Sixt <j6t@kdbg.org>
      
     @@ gitk-git/gitk: proc prefspage_colors {notebook} {
      +                    [mc "Main text"] \
                           [mc "foreground"] \
               diffold     diffcolors 0 \
     -                     [mc "Diff: old lines"] \
     +-                    [mc "Diff: old lines"] \
     ++                    [mc "Old line text"] \
                           [mc "diff old lines"] \
               diffoldbg   diffbgcolors 0 \
      -                    [mc "Diff: old lines bg"] \
     -+                    [mc "Diff: old lines background"] \
     ++                    [mc "Old line background"] \
                           [mc "diff old lines bg"] \
               diffnew     diffcolors 1 \
     -                     [mc "Diff: new lines"] \
     +-                    [mc "Diff: new lines"] \
     ++                    [mc "New line text"] \
                           [mc "diff new lines"] \
               diffnewbg   diffbgcolors 1 \
      -                    [mc "Diff: new lines bg"] \
     -+                    [mc "Diff: new lines background"] \
     ++                    [mc "New line background"] \
                           [mc "diff new lines bg"] \
               hunksep     diffcolors 2 \
      -                    [mc "Diff: hunk header"] \
     -+                    [mc "Diff: hunk headers"] \
     ++                    [mc "Hunk header text"] \
                           [mc "diff hunk header"] \
               markbg      markbgcolor {} \
      -                    [mc "Marked line bg"] \
     -+                    [mc "Marked lines background"] \
     ++                    [mc "Marked line background"] \
                           [mc "marked line background"] \
               selbg       selectbgcolor {} \
      -                    [mc "Select bg"] \
 5:  1e1bcfaf5b ! 5:  697159c20e gitk: avoid constructing dialog titles from text pieces
     @@ gitk-git/gitk: proc prefspage_colors {notebook} {
      -                    [mc "foreground"] \
      +                    [mc "choose main text color"] \
               diffold     diffcolors 0 \
     -                     [mc "Diff: old lines"] \
     +                     [mc "Old line text"] \
      -                    [mc "diff old lines"] \
      +                    [mc "choose text color of old lines"] \
               diffoldbg   diffbgcolors 0 \
     -                     [mc "Diff: old lines background"] \
     +                     [mc "Old line background"] \
      -                    [mc "diff old lines bg"] \
      +                    [mc "choose background color of old lines"] \
               diffnew     diffcolors 1 \
     -                     [mc "Diff: new lines"] \
     +                     [mc "New line text"] \
      -                    [mc "diff new lines"] \
      +                    [mc "choose text color of new lines"] \
               diffnewbg   diffbgcolors 1 \
     -                     [mc "Diff: new lines background"] \
     +                     [mc "New line background"] \
      -                    [mc "diff new lines bg"] \
      +                    [mc "choose background color of new lines"] \
               hunksep     diffcolors 2 \
     -                     [mc "Diff: hunk headers"] \
     +                     [mc "Hunk header text"] \
      -                    [mc "diff hunk header"] \
     -+                    [mc "choose hunk header color"] \
     ++                    [mc "choose text color of hunk headers"] \
               markbg      markbgcolor {} \
     -                     [mc "Marked lines background"] \
     +                     [mc "Marked line background"] \
      -                    [mc "marked line background"] \
      +                    [mc "choose background color of marked lines"] \
               selbg       selectbgcolor {} \
 -:  ---------- > 6:  36590e857d gitk: move UI for generic colors above diff colors

-- 
gitgitgadget

  parent reply	other threads:[~2026-08-12 13:16 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06  6:40 [PATCH 0/5] gitk: make color preferences visually more pleasing and better usable Johannes Sixt via GitGitGadget
2026-08-06  6:40 ` [PATCH 1/5] gitk: set intitial colors of swatches using the available helper Johannes Sixt via GitGitGadget
2026-08-07 14:36   ` mark
2026-08-06  6:40 ` [PATCH 2/5] gitk: condense repetitive code around color buttons into foreach loops Johannes Sixt via GitGitGadget
2026-08-07 14:37   ` mark
2026-08-06  6:40 ` [PATCH 3/5] gitk: show color preferences on the button instead of the label Johannes Sixt via GitGitGadget
2026-08-07 14:37   ` mark
2026-08-08  9:33     ` Johannes Sixt
2026-08-06  6:40 ` [PATCH 4/5] gitk: use more natural language for labels of color preferences Johannes Sixt via GitGitGadget
2026-08-06  6:40 ` [PATCH 5/5] gitk: avoid constructing dialog titles from text pieces Johannes Sixt via GitGitGadget
2026-08-07 14:37   ` mark
2026-08-08 10:00     ` Johannes Sixt
2026-08-08 14:55       ` Mark Levedahl
2026-08-09  7:27         ` Johannes Sixt
2026-08-08 16:32       ` Junio C Hamano
2026-08-09  7:04         ` Johannes Sixt
2026-08-12 13:16 ` Johannes Sixt via GitGitGadget [this message]
2026-08-12 13:16   ` [PATCH v2 1/6] gitk: set intitial colors of swatches using the available helper Johannes Sixt via GitGitGadget
2026-08-12 13:16   ` [PATCH v2 2/6] gitk: condense repetitive code around color buttons into foreach loops Johannes Sixt via GitGitGadget
2026-08-12 13:16   ` [PATCH v2 3/6] gitk: show color preferences on the button instead of the label Johannes Sixt via GitGitGadget
2026-08-12 13:16   ` [PATCH v2 4/6] gitk: use more natural language for labels of color preferences Johannes Sixt via GitGitGadget
2026-08-12 13:16   ` [PATCH v2 5/6] gitk: avoid constructing dialog titles from text pieces Johannes Sixt via GitGitGadget
2026-08-12 13:16   ` [PATCH v2 6/6] gitk: move UI for generic colors above diff colors Johannes Sixt via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.2194.v2.git.1786540582.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=mlevedahl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.