Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 808e859

Browse files
committed
Fix rendering of icons
1 parent e5f269f commit 808e859

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

src/GitHub.VisualStudio/Base/TeamExplorerNavigationItemBase.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@ void OnThemeChanged()
4545
{
4646
try
4747
{
48-
var color = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTextColorKey);
49-
var brightness = color.GetBrightness();
50-
var dark = brightness > 0.5f;
51-
52-
Icon = SharedResources.GetDrawingForIcon(octicon, dark ? Colors.DarkThemeNavigationItem : Colors.LightThemeNavigationItem, dark ? "dark" : "light");
48+
var theme = Colors.DetectTheme();
49+
var dark = theme == "Dark";
50+
Icon = SharedResources.GetDrawingForIcon(octicon, dark ? Colors.DarkThemeNavigationItem : Colors.LightThemeNavigationItem, theme);
5351
}
5452
catch (ArgumentNullException)
5553
{

src/GitHub.VisualStudio/Services/SharedResources.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public static DrawingBrush GetDrawingForIcon(Octicon icon, Brush colorBrush, str
2727
Drawing = new GeometryDrawing()
2828
{
2929
Brush = colorBrush,
30-
Pen = new Pen(colorBrush, 1.0).FreezeThis(),
3130
Geometry = OcticonPath.GetGeometryForIcon(icon).FreezeThis()
3231
}
3332
.FreezeThis(),

src/GitHub.VisualStudio/TeamExplorer/Connect/GitHubInvitationSection.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,9 @@ void OnThemeChanged()
6464
{
6565
try
6666
{
67-
var color = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTextColorKey);
68-
var brightness = color.GetBrightness();
69-
var dark = brightness > 0.5f;
70-
71-
Icon = SharedResources.GetDrawingForIcon(Octicon.mark_github, dark ? Helpers.Colors.DarkThemeNavigationItem : Helpers.Colors.LightThemeNavigationItem, dark ? "dark" : "light");
67+
var theme = Helpers.Colors.DetectTheme();
68+
var dark = theme == "Dark";
69+
Icon = SharedResources.GetDrawingForIcon(Octicon.mark_github, dark ? Colors.White : Helpers.Colors.LightThemeNavigationItem, theme);
7270
}
7371
catch (ArgumentNullException)
7472
{

0 commit comments

Comments
 (0)