Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Publish to GitHub button in TE does not support high contrast #796
Comments
|
Hi @abuchholtzau, Yes this is currently failing because we're using a hack to detect the current VS theme and mistakenly identifying the high-contrast theme for a light theme. The code to detect the current theme is here: https://github.com/github/VisualStudio/blob/master/src/GitHub.VisualStudio.UI/Colors.cs#L35 There must be a better way to detect the current VS theme, but all I've found from googling are methods that involve reading a registry key, which strikes me as rather non-future-proof. How should we be detecting the current theme? |
- Remove `GitHubButton` style - this was the default style for all our buttons, but wasn't used anywhere. It appears to be the default style in GHfW but doesn't fit with Visual Studio. By removing this default style, buttons in Team Explorer use the default button style - fixes #796. - Make `GitHubVsButton` the default style for buttons in the GitHub pane. We only currently have one button that's not a primary button ("Cancel" in the PR creation view) but it should be the default style for subsequent buttons there, so removed the style from that individual button and made it apply to all buttons.
|
@prasethu can you help advise a better way to detect the VS theme? |
|
@abuchholtzau @grokys The right way to do this would be to apply the Platform button style in XAML directly on your button.
|
|
Thanks @prasethu, it turns out we were overriding the default button style. Removing our overridden default button styled fixed it. It would still be useful if there was a decent way to detect the current theme, but that's now a separate issue. |
|
@grokys Why do you want to know what the current theme is? Your code should be agnostic to themes because we can add or change themes as we please. |
|
@grokys If this is specific to HighContrast, then there is the standard way: |
Steps
The text was updated successfully, but these errors were encountered: