Theme all buttons, checkboxes, groupboxes, and listboxes #3489
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.
Background
When Windows users ask for a dark theme, our answer has been to configure the WinForms system colors to be dark because the CKAN GUI obeys those colors. However, Microsoft decided to make these colors uneditable in recent versions of Windows.
One of my long-term TODO items has been to create a
DarkTheme.reg
file so Windows users could configure a dark theme even when their operating system does not allow them to access these settings. (I think I had previously tried to create a.theme
file, but it didn't go very well.)Problems
I started working on that reg file, and I made some progress, but some of the buttons, checkboxes, groupboxes, and listviews could not be fixed by tweaking the colors:
Expand for "before" screenshots
Causes
GroupBox
seems to set its text color to black regardless of the system colorsListView
requires some tweaking to look good, and these were left out of the previous pass of thatButton.FlatStyle
andCheckBox.FlatStyle
aren't set, then buttons and checkboxes are rendered with a garish "3D" style that obeys the system color for the text but ignores it for the backgroundChanges
GroupBox.ForeColor
toSystemColors.ControlText
ThemedListView
control replaces the few remaining plainListView
sFlatStyle
for all of our buttons and checkboxesGUI/DarkTheme.reg
file in the CKAN repo contains dark theming registry keys for Windows. It is a text file with 2 bytes per character thatregedit.exe
uses for exports, I think UTF-16 format? Once this is merged, we can add a link to this file on the wiki/forum/Discord, and users clicking it would be prompted like this:After they click Yes, restarting Windows will load the dark theme. It would be nice to host the file itself on the wiki as well, but the wiki can only host plain text content with no file extension, so adding it to the repo is the next best option.
/
on WindowsExpand for "after" screenshots