-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Polish peek view for inline reviews #1080
Changes from 40 commits
858ad49
a4ddc60
1484429
84e1662
6353aa4
b6e9d76
25b3343
ca08c3f
7ec6d8d
daa8f84
9ba4fac
a81fff4
e004037
e78b629
290f804
045d177
c2aee39
209a44d
e61e38e
3b70c76
9544e21
94f2d8d
38130b2
3ef16c2
4941dbd
db1e3a3
cd95652
17c0443
6e1750f
8aee33d
5ed1e99
1bb641c
aeedb1e
cdd40eb
0c396aa
1272564
af48b5d
1f44318
71821b0
ee3a425
e40fb48
cf40358
569257c
b6781f3
57f5321
d9774c6
e17cb9b
75b3531
57c044c
9c121be
9bce4b3
b0af9ba
f14b716
589d986
82e60b2
8d56e76
593b19f
7f04075
3a1e4e0
71e8d79
aebb7a7
744a910
bff81de
fd862e8
2ba07ba
025ee71
abd2d0b
3f4bd13
903b958
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,36 +2,55 @@ | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:cache="clr-namespace:GitHub.UI.Helpers;assembly=GitHub.UI" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
mc:Ignorable="d"> | ||
<UserControl.Resources> | ||
<SolidColorBrush x:Key="DiffChangeBackground" Color="DarkSlateGray" /> | ||
<SolidColorBrush x:Key="AddDiffChangeBackground" Color="Green" /> | ||
<SolidColorBrush x:Key="RemovedDiffChangeBackground" Color="Red" /> | ||
</UserControl.Resources> | ||
|
||
<Grid Background="{DynamicResource DiffChangeBackground}"> | ||
<Viewbox x:Name="AddViewbox"> | ||
<Path | ||
Data="M13 2H1c-0.55 0-1 0.45-1 1v8c0 0.55 0.45 1 1 1h2v3.5l3.5-3.5h6.5c0.55 0 1-0.45 1-1V3c0-0.55-0.45-1-1-1z m0 9H6L4 13V11H1V3h12v8z M7,5 L7,9 M5,7 L9,7"> | ||
<Path.Style> | ||
<Style TargetType="Path"> | ||
<!-- Resourcess are defined in \GitHub.VisualStudio.UI\Styles\Theme*.xaml (and Properties\DesignTimeResources.xaml) --> | ||
<UserControl.Style> | ||
<Style TargetType="UserControl"> | ||
<Style.Triggers> | ||
<DataTrigger Binding="{Binding DiffChangeType}" Value="Add"> | ||
<Setter Property="Background" Value="{DynamicResource GitHubDiffChangeBackground.Add}" /> | ||
</DataTrigger> | ||
|
||
<DataTrigger Binding="{Binding DiffChangeType}" Value="Delete"> | ||
<Setter Property="Background" Value="{DynamicResource GitHubDiffChangeBackground.Delete}" /> | ||
</DataTrigger> | ||
|
||
<DataTrigger Binding="{Binding DiffChangeType}" Value="None"> | ||
<Setter Property="Background" Value="{DynamicResource GitHubDiffChangeBackground.None}" /> | ||
</DataTrigger> | ||
</Style.Triggers> | ||
</Style> | ||
</UserControl.Style> | ||
|
||
<Grid> | ||
<Border BorderBrush="{DynamicResource VsBrush.ScrollBarBackground}" BorderThickness="0,0,1,0" /> | ||
<Viewbox x:Name="AddViewbox" Margin="1,1,0,0"> | ||
<Canvas Width="14" Height="14"> | ||
<Rectangle Width="13" Height="13" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup! The background is being set with a style. |
||
<Rectangle Stroke="#313131" Fill="Transparent" Opacity="0.163" Width="13" Height="13" /> | ||
<Path Canvas.Top="-0.5" Canvas.Left="-0.5" Fill="#FFF" Data="M11 8H8v3H6V8H3V6h3V3h2v3h3z"/> | ||
|
||
<Canvas.Resources> | ||
<Style TargetType="Rectangle"> | ||
<Style.Triggers> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these triggers still used? AFAICS the add glyph is now always the same color? |
||
<DataTrigger Binding="{Binding DiffChangeType}" Value="Add"> | ||
<Setter Property="Stroke" Value="{DynamicResource AddDiffChangeBackground}" /> | ||
<Setter Property="Fill" Value="{DynamicResource GitHubDiffGlyphFill.Add}" /> | ||
</DataTrigger> | ||
|
||
<DataTrigger Binding="{Binding DiffChangeType}" Value="None"> | ||
<Setter Property="Stroke" Value="{DynamicResource DiffChangeBackground}" /> | ||
<Setter Property="Fill" Value="{DynamicResource GitHubDiffGlyphFill.None}" /> | ||
</DataTrigger> | ||
|
||
<DataTrigger Binding="{Binding DiffChangeType}" Value="Delete"> | ||
<Setter Property="Stroke" Value="{DynamicResource RemovedDiffChangeBackground}" /> | ||
<Setter Property="Fill" Value="{DynamicResource GitHubDiffGlyphFill.Delete}" /> | ||
</DataTrigger> | ||
</Style.Triggers> | ||
</Style> | ||
</Path.Style> | ||
</Path> | ||
</Canvas.Resources> | ||
</Canvas> | ||
</Viewbox> | ||
</Grid> | ||
</UserControl> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,22 +3,63 @@ | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:cache="clr-namespace:GitHub.UI.Helpers;assembly=GitHub.UI" | ||
mc:Ignorable="d" | ||
ToolTipService.ShowDuration="600000" ToolTipService.HasDropShadow="True"> | ||
ToolTipService.ShowDuration="600000"> | ||
|
||
<UserControl.Resources> | ||
<!-- This will be the color of an added/deleted word in the diff view or the indicator margin color --> | ||
<SolidColorBrush x:Key="DiffChangeBackground" Color="DarkSlateGray" /> | ||
</UserControl.Resources> | ||
<!-- Resourcess are defined in \GitHub.VisualStudio.UI\Styles\Theme*.xaml (and Properties\DesignTimeResources.xaml) --> | ||
<UserControl.Style> | ||
<Style TargetType="UserControl"> | ||
<Style.Triggers> | ||
<DataTrigger Binding="{Binding DiffChangeType}" Value="Add"> | ||
<Setter Property="Background" Value="{DynamicResource GitHubDiffChangeBackground.Add}" /> | ||
</DataTrigger> | ||
|
||
<UserControl.ToolTip> | ||
<ToolTip x:Name="CommentToolTip" /> | ||
</UserControl.ToolTip> | ||
<DataTrigger Binding="{Binding DiffChangeType}" Value="Delete"> | ||
<Setter Property="Background" Value="{DynamicResource GitHubDiffChangeBackground.Delete}" /> | ||
</DataTrigger> | ||
|
||
<DataTrigger Binding="{Binding DiffChangeType}" Value="None"> | ||
<Setter Property="Background" Value="{DynamicResource GitHubDiffChangeBackground.None}" /> | ||
</DataTrigger> | ||
</Style.Triggers> | ||
</Style> | ||
</UserControl.Style> | ||
|
||
<Grid> | ||
<Viewbox HorizontalAlignment="Center" VerticalAlignment="Center"> | ||
<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.Resources> | ||
<Style TargetType="Path"> | ||
<Style.Triggers> | ||
<DataTrigger Binding="{Binding DiffChangeType}" Value="Add"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, are these triggers needed? |
||
<Setter Property="Fill" Value="{DynamicResource GitHubDiffGlyphFill.Add}" /> | ||
</DataTrigger> | ||
|
||
<Grid Background="{DynamicResource DiffChangeBackground}"> | ||
<Viewbox> | ||
<Path Stroke="Black" | ||
Data="M13 2H1c-0.55 0-1 0.45-1 1v8c0 0.55 0.45 1 1 1h2v3.5l3.5-3.5h6.5c0.55 0 1-0.45 1-1V3c0-0.55-0.45-1-1-1z m0 9H6L4 13V11H1V3h12v8z"/> | ||
<DataTrigger Binding="{Binding DiffChangeType}" Value="None"> | ||
<Setter Property="Fill" Value="{DynamicResource GitHubDiffGlyphFill.None}" /> | ||
</DataTrigger> | ||
|
||
<DataTrigger Binding="{Binding DiffChangeType}" Value="Delete"> | ||
<Setter Property="Fill" Value="{DynamicResource GitHubDiffGlyphFill.Delete}" /> | ||
</DataTrigger> | ||
</Style.Triggers> | ||
</Style> | ||
</Canvas.Resources> | ||
</Canvas> | ||
</Viewbox> | ||
</Grid> | ||
|
||
<UserControl.ToolTip> | ||
<ToolTip | ||
Background="{DynamicResource GitHubVsToolWindowBackground}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can now access the GitHub dynamic/themed resources from the glyph XAML files (this wouldn't have worked before). You can see I'm using |
||
Foreground="{DynamicResource GitHubVsToolWindowText}" | ||
x:Name="CommentToolTip" /> | ||
</UserControl.ToolTip> | ||
|
||
</UserControl> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just doing a little comment to see how it looks...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and replying to myself in the extension!