diff --git a/src/EditorFeatures/Core.Wpf/InlineRename/UI/Adornment/RenameFlyout.xaml b/src/EditorFeatures/Core.Wpf/InlineRename/UI/Adornment/RenameFlyout.xaml index be642b6dfac18..36632cbe37f86 100644 --- a/src/EditorFeatures/Core.Wpf/InlineRename/UI/Adornment/RenameFlyout.xaml +++ b/src/EditorFeatures/Core.Wpf/InlineRename/UI/Adornment/RenameFlyout.xaml @@ -12,7 +12,6 @@ xmlns:vsui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" - MinWidth="200" KeyDown="Adornment_KeyDown" MouseDown="Adornment_ConsumeMouseEvent" MouseUp="Adornment_ConsumeMouseEvent" @@ -97,13 +96,14 @@ - + @@ -125,6 +125,7 @@ Text="{Binding ElementName=control, Path=SubmitText}" Margin="5, 5, 0, 0" FontStyle="Italic" + TextWrapping="Wrap" /> diff --git a/src/EditorFeatures/Core.Wpf/InlineRename/UI/Adornment/RenameFlyout.xaml.cs b/src/EditorFeatures/Core.Wpf/InlineRename/UI/Adornment/RenameFlyout.xaml.cs index 4b35e3e3832f6..ad8b1fbd8e1f3 100644 --- a/src/EditorFeatures/Core.Wpf/InlineRename/UI/Adornment/RenameFlyout.xaml.cs +++ b/src/EditorFeatures/Core.Wpf/InlineRename/UI/Adornment/RenameFlyout.xaml.cs @@ -23,6 +23,8 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename /// internal partial class RenameFlyout : InlineRenameAdornment { + private const int DefaultMinWidth = 200; + private readonly RenameFlyoutViewModel _viewModel; private readonly IEditorFormatMap _editorFormatMap; private readonly IWpfTextView _textView; @@ -147,8 +149,11 @@ private void PositionAdornment() ? _textView.ViewportRight - width : desiredLeft; - Canvas.SetTop(this, top); - Canvas.SetLeft(this, left); + MaxWidth = _textView.ViewportRight; + MinWidth = Math.Min(DefaultMinWidth, _textView.ViewportWidth); + + Canvas.SetTop(this, Math.Max(0, top)); + Canvas.SetLeft(this, Math.Max(0, left)); } public override void Dispose()