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

Update inline review / annotation margin glyph #2077

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions src/GitHub.InlineReviews/GitHub.InlineReviews.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@
<Compile Include="Services\PullRequestSessionManager.cs" />
<Compile Include="Margins\InlineCommentMarginProvider.cs" />
<Compile Include="Services\PullRequestSessionService.cs" />
<Compile Include="Tags\ShowInlineAnnotationGlyph.xaml.cs">
<DependentUpon>ShowInlineAnnotationGlyph.xaml</DependentUpon>
</Compile>
<Compile Include="Tags\ShowInlineCommentAnnotationGlyph.xaml.cs">
<DependentUpon>ShowInlineCommentAnnotationGlyph.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModels\PullRequestFileMarginViewModel.cs" />
<Compile Include="ViewModels\InlineCommentPeekViewModel.cs" />
<Compile Include="ViewModels\PullRequestStatusViewModel.cs" />
Expand Down Expand Up @@ -414,14 +408,6 @@
<SubType>Designer</SubType>
<ContainsDesignTimeResources>true</ContainsDesignTimeResources>
</Page>
<Page Include="Tags\ShowInlineAnnotationGlyph.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Tags\ShowInlineCommentAnnotationGlyph.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\PullRequestFileMarginView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
20 changes: 1 addition & 19 deletions src/GitHub.InlineReviews/Tags/InlineCommentGlyphFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,7 @@ static UserControl CreateGlyph(InlineCommentTag tag)

if (showTag != null)
{
if (showTag.Thread != null && showTag.Annotations != null)
{
return new ShowInlineCommentAnnotationGlyph();
}

if (showTag.Thread != null)
{
return new ShowInlineCommentGlyph
{
Opacity = showTag.Thread.IsStale ? 0.5 : 1,
};
}

if (showTag.Annotations != null)
{
return new ShowInlineAnnotationGlyph();
}

throw new ArgumentException($"{nameof(showTag)} does not have a thread or annotations");
return new ShowInlineCommentGlyph();
}

throw new ArgumentException($"Unknown 'InlineCommentTag' type '{tag}'");
Expand Down
25 changes: 0 additions & 25 deletions src/GitHub.InlineReviews/Tags/ShowInlineAnnotationGlyph.xaml

This file was deleted.

14 changes: 0 additions & 14 deletions src/GitHub.InlineReviews/Tags/ShowInlineAnnotationGlyph.xaml.cs

This file was deleted.

This file was deleted.

This file was deleted.

19 changes: 14 additions & 5 deletions src/GitHub.InlineReviews/Tags/ShowInlineCommentGlyph.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,25 @@
<Grid>
<Border Background="{DynamicResource GitHubGlyphMarginCommentableBackground}" BorderThickness="0,0,1,0" />
<Viewbox HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,1,0,0">
<Canvas Width="16" Height="15">
<Path Canvas.Top="1" Canvas.Left="0.85"
Data="M1,0 C0.45,0 0,0.45 0,1 L0,9 C0,9.55 0.45,10 1,10 L3,10 L3,13.5 L6.5,10 L13,10 C13.55,10 14,9.55 14,9 L14,1 C14,0.45 13.55,0 13,0 L1,0 Z" />
<Path Canvas.Top="1" Canvas.Left="0.85" Opacity="0.163" Stroke="#313131"
Data="M3.5,12.2928932 L6.29289322,9.5 L13,9.5 C13.2738576,9.5 13.5,9.27385763 13.5,9 L13.5,1 C13.5,0.726142375 13.2738576,0.5 13,0.5 L1,0.5 C0.726142375,0.5 0.5,0.726142375 0.5,1 L0.5,9 C0.5,9.27385763 0.726142375,9.5 1,9.5 L3.5,9.5 L3.5,12.2928932 Z" />
<Canvas Width="16" Height="16">
<Canvas.Resources>
<Style TargetType="Path">
<Setter Property="Fill" Value="{DynamicResource GitHubDiffGlyphFill.None}" />
<Setter Property="Stroke" Value="{DynamicResource GitHubDiffGlyphFill.None}" />
</Style>
</Canvas.Resources>

<Rectangle Width="8"
Height="8"
Canvas.Top="2.3"
Canvas.Left="2.3"
Fill="#959da5"
Stroke="White"
StrokeThickness="1">
<Rectangle.LayoutTransform>
<RotateTransform Angle="-45" />
</Rectangle.LayoutTransform>
</Rectangle>
</Canvas>
</Viewbox>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub.VisualStudio.UI/Views/CommentView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
AcceptsReturn="True"
AcceptsTab="True"
IsReadOnly="{Binding IsReadOnly}"
Margin="4 0"
Margin="4 0 4 4"
Text="{Binding Body, UpdateSourceTrigger=PropertyChanged}"
TextWrapping="Wrap"
VerticalAlignment="Center"
Expand Down