|
|
|
@ -110,9 +110,9 @@ namespace ICSharpCode.ILSpy.TextView
@@ -110,9 +110,9 @@ namespace ICSharpCode.ILSpy.TextView
|
|
|
|
|
textEditor.TextArea.Caret.PositionChanged += HighlightBrackets; |
|
|
|
|
textEditor.MouseMove += TextEditorMouseMove; |
|
|
|
|
textEditor.MouseLeave += TextEditorMouseLeave; |
|
|
|
|
textEditor.SetBinding(Control.FontFamilyProperty, new Binding { Source = DisplaySettingsPanel.CurrentDisplaySettings, Path = new PropertyPath("SelectedFont") }); |
|
|
|
|
textEditor.SetBinding(Control.FontSizeProperty, new Binding { Source = DisplaySettingsPanel.CurrentDisplaySettings, Path = new PropertyPath("SelectedFontSize") }); |
|
|
|
|
textEditor.SetBinding(TextEditor.WordWrapProperty, new Binding { Source = DisplaySettingsPanel.CurrentDisplaySettings, Path = new PropertyPath("EnableWordWrap") }); |
|
|
|
|
textEditor.SetBinding(Control.FontFamilyProperty, new Binding { Source = MainWindow.Instance.CurrentDisplaySettings, Path = new PropertyPath("SelectedFont") }); |
|
|
|
|
textEditor.SetBinding(Control.FontSizeProperty, new Binding { Source = MainWindow.Instance.CurrentDisplaySettings, Path = new PropertyPath("SelectedFontSize") }); |
|
|
|
|
textEditor.SetBinding(TextEditor.WordWrapProperty, new Binding { Source = MainWindow.Instance.CurrentDisplaySettings, Path = new PropertyPath("EnableWordWrap") }); |
|
|
|
|
|
|
|
|
|
// disable Tab editing command (useless for read-only editor); allow using tab for focus navigation instead
|
|
|
|
|
RemoveEditCommand(EditingCommands.TabForward); |
|
|
|
@ -122,7 +122,7 @@ namespace ICSharpCode.ILSpy.TextView
@@ -122,7 +122,7 @@ namespace ICSharpCode.ILSpy.TextView
|
|
|
|
|
textEditor.TextArea.TextView.BackgroundRenderers.Add(textMarkerService); |
|
|
|
|
textEditor.TextArea.TextView.LineTransformers.Add(textMarkerService); |
|
|
|
|
textEditor.ShowLineNumbers = true; |
|
|
|
|
DisplaySettingsPanel.CurrentDisplaySettings.PropertyChanged += CurrentDisplaySettings_PropertyChanged; |
|
|
|
|
MainWindow.Instance.CurrentDisplaySettings.PropertyChanged += CurrentDisplaySettings_PropertyChanged; |
|
|
|
|
|
|
|
|
|
// SearchPanel
|
|
|
|
|
SearchPanel searchPanel = SearchPanel.Install(textEditor.TextArea); |
|
|
|
@ -190,14 +190,14 @@ namespace ICSharpCode.ILSpy.TextView
@@ -190,14 +190,14 @@ namespace ICSharpCode.ILSpy.TextView
|
|
|
|
|
{ |
|
|
|
|
if (margin is LineNumberMargin || margin is System.Windows.Shapes.Line) |
|
|
|
|
{ |
|
|
|
|
margin.Visibility = DisplaySettingsPanel.CurrentDisplaySettings.ShowLineNumbers ? Visibility.Visible : Visibility.Collapsed; |
|
|
|
|
margin.Visibility = MainWindow.Instance.CurrentDisplaySettings.ShowLineNumbers ? Visibility.Visible : Visibility.Collapsed; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SetHighlightCurrentLine() |
|
|
|
|
{ |
|
|
|
|
textEditor.Options.HighlightCurrentLine = DisplaySettingsPanel.CurrentDisplaySettings.HighlightCurrentLine; |
|
|
|
|
textEditor.Options.HighlightCurrentLine = MainWindow.Instance.CurrentDisplaySettings.HighlightCurrentLine; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
@ -480,7 +480,7 @@ namespace ICSharpCode.ILSpy.TextView
@@ -480,7 +480,7 @@ namespace ICSharpCode.ILSpy.TextView
|
|
|
|
|
public FlowDocumentTooltip(FlowDocument document) |
|
|
|
|
{ |
|
|
|
|
TextOptions.SetTextFormattingMode(this, TextFormattingMode.Display); |
|
|
|
|
double fontSize = DisplaySettingsPanel.CurrentDisplaySettings.SelectedFontSize; |
|
|
|
|
double fontSize = MainWindow.Instance.CurrentDisplaySettings.SelectedFontSize; |
|
|
|
|
viewer = new FlowDocumentScrollViewer() { |
|
|
|
|
Width = document.MinPageWidth + fontSize * 5, |
|
|
|
|
MaxWidth = MainWindow.Instance.ActualWidth |
|
|
|
@ -527,7 +527,7 @@ namespace ICSharpCode.ILSpy.TextView
@@ -527,7 +527,7 @@ namespace ICSharpCode.ILSpy.TextView
|
|
|
|
|
#region Highlight brackets
|
|
|
|
|
void HighlightBrackets(object? sender, EventArgs e) |
|
|
|
|
{ |
|
|
|
|
if (DisplaySettingsPanel.CurrentDisplaySettings.HighlightMatchingBraces) |
|
|
|
|
if (MainWindow.Instance.CurrentDisplaySettings.HighlightMatchingBraces) |
|
|
|
|
{ |
|
|
|
|
var result = MainWindow.Instance.CurrentLanguage.BracketSearcher.SearchBracket(textEditor.Document, textEditor.CaretOffset); |
|
|
|
|
bracketHighlightRenderer.SetHighlight(result); |
|
|
|
@ -734,7 +734,7 @@ namespace ICSharpCode.ILSpy.TextView
@@ -734,7 +734,7 @@ namespace ICSharpCode.ILSpy.TextView
|
|
|
|
|
{ |
|
|
|
|
if (state != null) |
|
|
|
|
{ |
|
|
|
|
state.RestoreFoldings(textOutput.Foldings, DisplaySettingsPanel.CurrentDisplaySettings.ExpandMemberDefinitions); |
|
|
|
|
state.RestoreFoldings(textOutput.Foldings, MainWindow.Instance.CurrentDisplaySettings.ExpandMemberDefinitions); |
|
|
|
|
textEditor.ScrollToVerticalOffset(state.VerticalOffset); |
|
|
|
|
textEditor.ScrollToHorizontalOffset(state.HorizontalOffset); |
|
|
|
|
} |
|
|
|
@ -758,7 +758,7 @@ namespace ICSharpCode.ILSpy.TextView
@@ -758,7 +758,7 @@ namespace ICSharpCode.ILSpy.TextView
|
|
|
|
|
} |
|
|
|
|
currentAddress = textOutput.Address; |
|
|
|
|
currentTitle = textOutput.Title; |
|
|
|
|
expandMemberDefinitions = DisplaySettingsPanel.CurrentDisplaySettings.ExpandMemberDefinitions; |
|
|
|
|
expandMemberDefinitions = MainWindow.Instance.CurrentDisplaySettings.ExpandMemberDefinitions; |
|
|
|
|
} |
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@ -1215,7 +1215,7 @@ namespace ICSharpCode.ILSpy.TextView
@@ -1215,7 +1215,7 @@ namespace ICSharpCode.ILSpy.TextView
|
|
|
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
{ |
|
|
|
|
DisplaySettingsPanel.CurrentDisplaySettings.PropertyChanged -= CurrentDisplaySettings_PropertyChanged; |
|
|
|
|
MainWindow.Instance.CurrentDisplaySettings.PropertyChanged -= CurrentDisplaySettings_PropertyChanged; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#region Unfold
|
|
|
|
|