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

Commit 4f35532

Browse files
committed
Define default width in separate field
Fix `if(` spacing.
1 parent 47963ca commit 4f35532

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/GitHub.InlineReviews/Glyph/GlyphMargin.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ namespace GitHub.InlineReviews.Glyph
1818
/// <typeparam name="TGlyphTag">The type of glyph tag we're managing.</typeparam>
1919
public sealed class GlyphMargin<TGlyphTag> : IWpfTextViewMargin, ITextViewMargin, IDisposable where TGlyphTag: ITag
2020
{
21+
const double DefaultMarginWidth = 17.0;
22+
2123
bool handleZoom;
2224
bool isDisposed;
2325
Grid marginVisual;
@@ -34,7 +36,7 @@ public GlyphMargin(
3436
Grid marginVisual,
3537
ITagAggregator<TGlyphTag> tagAggregator,
3638
IEditorFormatMap editorFormatMap,
37-
string marginPropertiesName, string marginName, bool handleZoom = true, double marginWidth = 17.0)
39+
string marginPropertiesName, string marginName, bool handleZoom = true, double marginWidth = DefaultMarginWidth)
3840
{
3941
textView = wpfTextViewHost.TextView;
4042
this.tagAggregator = tagAggregator;

src/GitHub.InlineReviews/InlineCommentMarginProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ IWpfTextViewMargin CreateMargin<TGlyphTag>(IGlyphFactory<TGlyphTag> glyphFactory
6767
glyphMarginView.Unloaded += (s, e) => glyphMarginViewModel.Dispose();
6868

6969
var margin = new GlyphMargin<TGlyphTag>(wpfTextViewHost, glyphFactory, glyphMarginView, tagAggregator, editorFormatMap,
70-
MarginPropertiesName, MarginName, true, 17.0);
70+
MarginPropertiesName, MarginName, true);
7171

72-
if(IsDiffView(wpfTextViewHost))
72+
if (IsDiffView(wpfTextViewHost))
7373
{
7474
TrackCommentGlyph(wpfTextViewHost, glyphMarginView);
7575
}

src/GitHub.InlineReviews/ViewModels/GlyphMarginViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void Dispose()
3535

3636
void PackageSettings_PropertyChanged(object sender, PropertyChangedEventArgs e)
3737
{
38-
if(e.PropertyName == nameof(packageSettings.EditorComments))
38+
if (e.PropertyName == nameof(packageSettings.EditorComments))
3939
{
4040
RefreshVisibility();
4141
}
@@ -75,7 +75,7 @@ public bool Visible
7575
{
7676
private set
7777
{
78-
if(value != visible)
78+
if (value != visible)
7979
{
8080
visible = value;
8181
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Visible)));

0 commit comments

Comments
 (0)