Make color preferences visually more pleasing and better usable - #48
Open
j6t wants to merge 6 commits into
Open
Conversation
After the user has selected a color in the Preferences dialog, 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>
The color selection elements in the Preferences dialog are set up in a very uniform manner. The code doing that has grown in the past by simply modifying a copy of a paragraph. Extract the varying parts into a list and then operate the repeating parts in a foreach loop. This helps a later change where we want to set up the UI elements in a different way. Change the UI names "markbgsep" and "selbgsep" to drop the "sep", which has obviously been left over by accident when "hunksep" was copied. Change the suffix "but" to "btn", which resonates a bit better when reading the code. Signed-off-by: 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>
The labels used to be clickable buttons. These would have looked funny 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>
When the user clicks a color preference, a color selection dialog is presented whose title is provided in parts by the caller. The dialog implementation must supply the rest of the title. This is unfriendly for translations. Provide the full title by the caller. Rewrite the texts to be more natural language. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
The selection and link colors apply not only to the diff panel, but also to the the commit list. Move these right after the generic background and text color options. The color for marked lines is only used in the diff panel, hence, leave it below the diff color options. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
j6t
force-pushed
the
js/prefs-color-buttons
branch
from
August 12, 2026 11:29
22c2797 to
40ca78d
Compare
Owner
Author
|
Changes since the last round:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.
This is the dialog before the change:


And this is the dialog after the change: