Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 46011fb

Browse files
committed
Merge branch 'feature/inline-reviews' of https://github.com/github/VisualStudio into feature/inline-reviews
2 parents 41a76f8 + 21821b2 commit 46011fb

File tree

2 files changed

+25
-63
lines changed

2 files changed

+25
-63
lines changed

src/GitHub.InlineReviews/Glyph/GlyphMargin.cs

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,34 @@ public void Dispose()
6363

6464
public ITextViewMargin GetTextViewMargin(string marginName)
6565
{
66-
if (marginName == this.marginName)
66+
return (marginName == this.marginName) ? this : null;
67+
}
68+
69+
public bool Enabled
70+
{
71+
get
72+
{
73+
ThrowIfDisposed();
74+
return true;
75+
}
76+
}
77+
78+
public double MarginSize
79+
{
80+
get
6781
{
68-
return this;
82+
ThrowIfDisposed();
83+
return marginVisual.Width;
6984
}
85+
}
7086

71-
return null;
87+
public FrameworkElement VisualElement
88+
{
89+
get
90+
{
91+
ThrowIfDisposed();
92+
return marginVisual;
93+
}
7294
}
7395

7496
void OnLoaded(object sender, RoutedEventArgs e)
@@ -117,13 +139,11 @@ void OnBatchedTagsChanged(object sender, BatchedTagsChangedEventArgs e)
117139
{
118140
var span = list[0];
119141
int start = span.Start;
120-
span = list[0];
121142
int end = span.End;
122143
for (int i = 1; i < list.Count; i++)
123144
{
124145
span = list[i];
125146
start = Math.Min(start, span.Start);
126-
span = list[i];
127147
end = Math.Max(end, span.End);
128148
}
129149

@@ -184,32 +204,5 @@ void ThrowIfDisposed()
184204
throw new ObjectDisposedException(marginName);
185205
}
186206
}
187-
188-
public bool Enabled
189-
{
190-
get
191-
{
192-
ThrowIfDisposed();
193-
return true;
194-
}
195-
}
196-
197-
public double MarginSize
198-
{
199-
get
200-
{
201-
ThrowIfDisposed();
202-
return marginVisual.Width;
203-
}
204-
}
205-
206-
public FrameworkElement VisualElement
207-
{
208-
get
209-
{
210-
ThrowIfDisposed();
211-
return marginVisual;
212-
}
213-
}
214207
}
215208
}

src/GitHub.InlineReviews/Glyph/GlyphMarginVisualManager.cs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,6 @@ public void AddGlyph(TGlyphTag tag, SnapshotSpan span)
7373
element.Height = startingLine.TextHeight + 1; // HACK: +1 to fill gaps
7474
data.SetTop(startingLine.TextTop - textView.ViewportTop);
7575

76-
// draw where line is
77-
//element.Height = startingLine.Height;
78-
//data.SetTop(startingLine.Top - textView.ViewportTop);
79-
80-
// center on margin
81-
//element.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
82-
//double length = (17.0 - element.DesiredSize.Width) / 2.0;
83-
//Canvas.SetLeft(element, length);
84-
8576
glyphs[element] = data;
8677
visuals[glyphType].Children.Add(element);
8778
}
@@ -199,28 +190,6 @@ void UpdateBackgroundColor()
199190
var backgroundColor = (Color)properties["BackgroundColor"];
200191
ImageThemingUtilities.SetImageBackgroundColor(glyphMarginGrid, backgroundColor);
201192
}
202-
203-
// set background color for margin
204-
//var properties = editorFormatMap.GetProperties(marginPropertiesName);
205-
//if (properties.Contains("BackgroundColor"))
206-
//{
207-
// glyphMarginGrid.Background = new SolidColorBrush((Color)properties["BackgroundColor"]);
208-
// glyphMarginGrid.Background.Freeze();
209-
//}
210-
//else if (properties.Contains("Background"))
211-
//{
212-
// glyphMarginGrid.Background = (Brush)properties["Background"];
213-
//}
214-
//else
215-
//{
216-
// glyphMarginGrid.Background = Brushes.Transparent;
217-
//}
218-
219-
//var background = glyphMarginGrid.Background as SolidColorBrush;
220-
//if (background != null)
221-
//{
222-
// ImageThemingUtilities.SetImageBackgroundColor(glyphMarginGrid, background.Color);
223-
//}
224193
}
225194
}
226195
}

0 commit comments

Comments
 (0)