Skip to content

Commit

Permalink
! Use theme instead of specifying foreground color for hyper links in…
Browse files Browse the repository at this point in the history
… Quick Info (#347)
  • Loading branch information
wmjordan committed Feb 14, 2025
1 parent a40a182 commit 8bfdf03
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions Codist/Codist.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
<Compile Include="Commands\ShowSupportedFileTypesCommand.cs" />
<Compile Include="Commands\TransformDocumentWindow.cs" />
<Compile Include="Controls\ThemedRichTextBox.cs" />
<Compile Include="Controls\ThemedHyperlink.cs" />
<Compile Include="Commands\CancelRepeatingActionCommand.cs" />
<Compile Include="Helpers\VsImageHelper.cs" />
<Compile Include="Semantics\ArgumentAssignment.cs" />
Expand Down
13 changes: 13 additions & 0 deletions Codist/Controls/ThemedHyperlink.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Windows.Documents;
using Microsoft.VisualStudio.Shell;

namespace Codist.Controls
{
public class ThemedHyperlink : Hyperlink
{
public ThemedHyperlink() {
SetResourceReference(StyleProperty, VsResourceKeys.ThemedDialogHyperlinkStyleKey);
}
}
}
3 changes: 1 addition & 2 deletions Codist/Semantics/XmlDocRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,9 @@ static string UnindentTextBlock(string text) {
}

void CreateLink(InlineCollection inlines, XElement e, string url) {
var link = new Hyperlink {
var link = new ThemedHyperlink {
NavigateUri = new Uri(url),
ToolTip = e.Attribute("title") != null ? $"{e.Attribute("title").Value}{Environment.NewLine}{url}" : url,
Foreground = ThemeHelper.HyperlinkBrush
}.ClickToNavigate();
if (e.IsEmpty) {
link.Inlines.Add(url);
Expand Down

0 comments on commit 8bfdf03

Please sign in to comment.