Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix text colors for dark themes #2540

Merged
merged 1 commit into from
Oct 21, 2018

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Oct 15, 2018

Problems

In a dark theme, the status log and parts of the mod info pane feature dark text on a dark background:

image

image

Looks fine in a normal theme:

image

Causes

  1. A text box in .NET defaults to WindowText (black) on Window (white), but if you set its ReadOnly=true, as we do in this case, the background is changed to Control (dark gray) without changing the foreground, to give it a disabled appearance
  2. We set the ForeColor of the mod info pane labels to ControlDarkDark; the meaning of this value is:
    Gets a Color structure that is the dark shadow color of a 3-D element.
    This color is not meant to be used for text foreground colors, and using it assumes a light background color.

Changes

Now these places look better.

  1. The log text box's ForeColor is now ControlText, to match its background.
    image
  2. The labels in the mod info pane now have a ForeColor of GrayText, which the spec defines as "Gets a Color structure that is the color of dimmed text." This is meant to be used as a text color, and it will provide visual distinction from the normal text color:
    image
    Standard themes still look OK:
    image

Somewhat related to #2525 but not a fix for the specific things in that issue.

@HebaruSan HebaruSan added GUI Issues affecting the interactive GUI Pull request labels Oct 15, 2018
@Olympic1
Copy link
Member

Looks good. I personally have trouble reading the links on the dark theme, could it be possibe to give it a lighter color using LinkColor?

I find System.Drawing.SystemColors.Highlight a good one.

@HebaruSan
Copy link
Member Author

I'm not 100% sure Highlight is an improvement; at least in my theme, it's still pretty hard to read:

image

That's intended to be used as a background color for a selected element, and I'd rather not risk making things worse for some users by using it in a "clever" way. (The fact that SystemColors has no explicit LinkColor member says a lot about how long ago some of this stuff must have been designed!)

@Olympic1 Olympic1 merged commit e7d7cc8 into KSP-CKAN:master Oct 21, 2018
Olympic1 added a commit that referenced this pull request Oct 21, 2018
@HebaruSan HebaruSan deleted the fix/dark-text-colors branch October 21, 2018 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI Issues affecting the interactive GUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants