[PATCH v2 0/6] gitk: make color preferences visually more pleasing and better usable

"Johannes Sixt via GitGitGadget" <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
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 <[email protected]>
 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 <[email protected]>
      
     @@ 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.