Browse Source

Fix margin in search text box

pull/2334/head
tom-englert 4 years ago
parent
commit
12a4bcca16
  1. 17
      ILSpy/TextView/DecompilerTextView.cs

17
ILSpy/TextView/DecompilerTextView.cs

@ -54,12 +54,15 @@ using ICSharpCode.Decompiler.Output;
using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.ILSpy.AvalonEdit; using ICSharpCode.ILSpy.AvalonEdit;
using ICSharpCode.ILSpy.Options; using ICSharpCode.ILSpy.Options;
using ICSharpCode.ILSpy.themes;
using ICSharpCode.ILSpy.TreeNodes; using ICSharpCode.ILSpy.TreeNodes;
using ICSharpCode.ILSpy.ViewModels; using ICSharpCode.ILSpy.ViewModels;
using Microsoft.Win32; using Microsoft.Win32;
using TomsToolbox.Wpf;
using ResourceKeys = ICSharpCode.ILSpy.themes.ResourceKeys;
namespace ICSharpCode.ILSpy.TextView namespace ICSharpCode.ILSpy.TextView
{ {
/// <summary> /// <summary>
@ -120,8 +123,16 @@ namespace ICSharpCode.ILSpy.TextView
DisplaySettingsPanel.CurrentDisplaySettings.PropertyChanged += CurrentDisplaySettings_PropertyChanged; DisplaySettingsPanel.CurrentDisplaySettings.PropertyChanged += CurrentDisplaySettings_PropertyChanged;
// SearchPanel // SearchPanel
SearchPanel.Install(textEditor.TextArea) SearchPanel searchPanel = SearchPanel.Install(textEditor.TextArea);
.RegisterCommands(Application.Current.MainWindow.CommandBindings); searchPanel.RegisterCommands(Application.Current.MainWindow.CommandBindings);
searchPanel.Loaded += (_, _) => {
// HACK: fix the hardcoded but misaligned margin of the search text box.
var textBox = searchPanel.VisualDescendants().OfType<TextBox>().FirstOrDefault();
if (textBox != null)
{
textBox.Margin = new Thickness(3);
}
};
ShowLineMargin(); ShowLineMargin();
SetHighlightCurrentLine(); SetHighlightCurrentLine();

Loading…
Cancel
Save