Skip to content

Commit

Permalink
warp QuickInfo text (#1981)
Browse files Browse the repository at this point in the history
  • Loading branch information
vasily-kirichenko authored and KevinRansom committed Dec 13, 2016
1 parent b4e7eb5 commit 3b01766
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions vsintegration/src/FSharp.Editor/QuickInfoProvider.fs
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ open System.Windows.Documents
type internal FSharpDeferredQuickInfoContent(content: string, textProperties: TextFormattingRunProperties) =
interface IDeferredQuickInfoContent with
override this.Create() : FrameworkElement =
let label = Label(Content = content)
label.SetValue(TextElement.BackgroundProperty, textProperties.BackgroundBrush)
label.SetValue(TextElement.ForegroundProperty, textProperties.ForegroundBrush)
label.SetValue(TextElement.FontFamilyProperty, textProperties.Typeface.FontFamily)
label.SetValue(TextElement.FontSizeProperty, textProperties.FontRenderingEmSize)
label.SetValue(TextElement.FontStyleProperty, if textProperties.Italic then FontStyles.Italic else FontStyles.Normal)
label.SetValue(TextElement.FontWeightProperty, if textProperties.Bold then FontWeights.Bold else FontWeights.Normal)
upcast label
let textBlock = TextBlock(Run(content), TextWrapping = TextWrapping.Wrap, TextTrimming = TextTrimming.None)
textBlock.SetValue(TextElement.BackgroundProperty, textProperties.BackgroundBrush)
textBlock.SetValue(TextElement.ForegroundProperty, textProperties.ForegroundBrush)
textBlock.SetValue(TextElement.FontFamilyProperty, textProperties.Typeface.FontFamily)
textBlock.SetValue(TextElement.FontSizeProperty, textProperties.FontRenderingEmSize)
textBlock.SetValue(TextElement.FontStyleProperty, if textProperties.Italic then FontStyles.Italic else FontStyles.Normal)
textBlock.SetValue(TextElement.FontWeightProperty, if textProperties.Bold then FontWeights.Bold else FontWeights.Normal)
upcast textBlock

[<Shared>]
[<ExportQuickInfoProvider(PredefinedQuickInfoProviderNames.Semantic, FSharpCommonConstants.FSharpLanguageName)>]
Expand Down

0 comments on commit 3b01766

Please sign in to comment.