|
37 | 37 | using Microsoft.VisualStudio.Text; |
38 | 38 | using Microsoft.VisualStudio.Utilities; |
39 | 39 | using Microsoft.VisualStudio.Text.Editor; |
| 40 | +using Microsoft.VisualStudio.Text.Classification; |
40 | 41 |
|
41 | 42 | namespace MonoDevelop.Debugger |
42 | 43 | { |
@@ -101,10 +102,19 @@ public MacDebuggerObjectNameView (MacObjectValueTreeView treeView) : base (treeV |
101 | 102 | textBufferFactory = CompositionManager.Instance.GetExportedValue<ITextBufferFactoryService> (); |
102 | 103 | var factory = CompositionManager.Instance.GetExportedValue<ICocoaTextEditorFactoryService> (); |
103 | 104 | contentType = contentTypeRegistry.GetContentType (DebuggerCompletion.ContentType); |
| 105 | + var editorFormatMapService = CompositionManager.Instance.GetExportedValue<IEditorFormatMapService> (); |
| 106 | + var appearanceCategory = Guid.NewGuid ().ToString (); |
| 107 | + var editorFormat = editorFormatMapService.GetEditorFormatMap (appearanceCategory); |
| 108 | + |
| 109 | + var resourceDictionary = editorFormat.GetProperties ("Plain Text"); |
| 110 | + resourceDictionary [ClassificationFormatDefinition.TypefaceId] = TextField.Font; |
| 111 | + resourceDictionary [ClassificationFormatDefinition.FontRenderingSizeId] = TextField.Font.PointSize - 1; |
| 112 | + editorFormat.SetProperties ("Plain Text", resourceDictionary); |
| 113 | + |
104 | 114 | var textBuffer = textBufferFactory.CreateTextBuffer ("", contentType); |
105 | 115 | editor = factory.CreateTextView (textBuffer); |
106 | 116 | editor.Options.SetOptionValue(DefaultTextViewOptions.UseVisibleWhitespaceId, false); |
107 | | - |
| 117 | + editor.Options.SetOptionValue (DefaultTextViewOptions.AppearanceCategory, appearanceCategory); |
108 | 118 | editor.VisualElement.TranslatesAutoresizingMaskIntoConstraints = false; |
109 | 119 | editorTextView = new NSView { TranslatesAutoresizingMaskIntoConstraints = false, WantsLayer = true }; |
110 | 120 | editorTextView.Layer.BackgroundColor = NSColor.White.CGColor; |
@@ -273,8 +283,8 @@ protected override void UpdateContents () |
273 | 283 | AddSubview (textView); |
274 | 284 | } |
275 | 285 |
|
276 | | - constraints.Add (textView.TopAnchor.ConstraintEqualToAnchor (TopAnchor, -1)); |
277 | | - constraints.Add (textView.BottomAnchor.ConstraintEqualToAnchor (BottomAnchor, -1)); |
| 286 | + constraints.Add (textView.TopAnchor.ConstraintEqualToAnchor (TopAnchor, (nfloat)editor.FormattedLineSource.BaseIndentation)); |
| 287 | + constraints.Add (textView.BottomAnchor.ConstraintEqualToAnchor (BottomAnchor, (nfloat)editor.FormattedLineSource.BaseIndentation)); |
278 | 288 | } else { |
279 | 289 | textView = TextField; |
280 | 290 |
|
|
0 commit comments