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

Separate XNATabControl text color for disabled / unselectable state #3

Merged

Conversation

Starkku
Copy link
Contributor

@Starkku Starkku commented Nov 30, 2019

Self-explanatory. Makes XNATabControl text appear with different color if control is disabled or tab is unselectable. This disabled text color is customizable and defaults to the same color used by disabled buttons by default.

Copy link
Owner

@Rampastring Rampastring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getter of the color can be simplified, looks good otherwise!

return _textColorDisabled.Value;

return UISettings.ActiveSettings.DisabledItemColor;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the null-coalescing operator ?? to simplify the code: return _textColorDisabled ?? UISettings.ActiveSettings.DisabledItemColor;

While at it, you can make use of expression bodies to change the currently-7-line getter into the following nice and simple piece of code:
get => _textColorDisabled ?? UISettings.ActiveSettings.DisabledItemColor;

@Rampastring Rampastring merged commit c16865f into Rampastring:master Jan 5, 2020
@Starkku Starkku deleted the feature/tabcontrol-textcolor branch January 6, 2020 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants