This repository was archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathInlineCommentPeekView.xaml
More file actions
160 lines (148 loc) · 8.89 KB
/
InlineCommentPeekView.xaml
File metadata and controls
160 lines (148 loc) · 8.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<UserControl x:Class="GitHub.InlineReviews.Views.InlineCommentPeekView"
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:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:GitHub.InlineReviews.Views"
xmlns:cache="clr-namespace:GitHub.UI.Helpers;assembly=GitHub.UI"
xmlns:ui="clr-namespace:GitHub.UI;assembly=GitHub.UI"
xmlns:ghfvs="https://github.com/github/VisualStudio"
mc:Ignorable="d"
d:DesignHeight="200" d:DesignWidth="500">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI;component/SharedDictionary.xaml" />
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI.Reactive;component/SharedDictionary.xaml" />
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.VisualStudio.UI;component/SharedDictionary.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="GitHubToolbarButton" TargetType="{x:Type Button}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}" BorderThickness="1">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.25" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource VsBrush.CommandBarHover}" />
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<DockPanel>
<Border DockPanel.Dock="Top"
Background="{DynamicResource {x:Static SystemColors.InfoBrushKey}}"
Padding="8">
<Border.Style>
<Style TargetType="Border">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Thread.NeedsPush}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<DockPanel>
<ui:OcticonImage DockPanel.Dock="Left" Icon="alert" Margin="0 0 8 0"/>
<TextBlock TextWrapping="Wrap" Text="{x:Static ghfvs:Resources.YouMustCommitAndPushYourChangesToAddACommentHere}"/>
</DockPanel>
</Border>
<Border DockPanel.Dock="Top"
Background="{DynamicResource {x:Static SystemColors.InfoBrushKey}}"
Padding="8">
<Border.Style>
<Style TargetType="Border">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Thread.IsResolved}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<DockPanel>
<ui:OcticonImage DockPanel.Dock="Left" Icon="info" Margin="0 0 8 0"/>
<TextBlock TextWrapping="Wrap" Text="{x:Static ghfvs:Resources.ThisConversationWasMarkedAsResolved}"/>
</DockPanel>
</Border>
<Border DockPanel.Dock="Top"
Background="{DynamicResource {x:Static SystemColors.InfoBrushKey}}"
Padding="8">
<Border.Style>
<Style TargetType="Border">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Thread.IsOutdated}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<DockPanel>
<ui:OcticonImage DockPanel.Dock="Left" Icon="alert" Margin="0 0 8 0"/>
<TextBlock TextWrapping="Wrap" Text="{x:Static ghfvs:Resources.YouAreViewingAnOutdatedVersionOfThisFile}"/>
</DockPanel>
</Border>
<Border DockPanel.Dock="Top"
BorderThickness="0 0 0 1"
Background="{DynamicResource VsBrush.CommandBarOptionsBackground}"
BorderBrush="{DynamicResource GitHubVsBrandedUIBorder}">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Left" >
<Button Margin="2 0" Padding="2" Command="{Binding PreviousComment}"
Style="{StaticResource GitHubToolbarButton}">
<Button.ToolTip>
<TextBlock FontSize="11" Text="{x:Static ghfvs:Resources.PreviousComment}"/>
</Button.ToolTip>
<Canvas Width="16" Height="16">
<!-- TODO: Double check these brushes since they don't seem like the right fill colors -->
<Polygon Points="10 2 5 8 8 8 8 12 12 12 12 8 15 8" Fill="{DynamicResource VsBrush.CommandBarOptionsGlyph}" StrokeThickness="1"/>
<Rectangle Canvas.Left="1.25" Canvas.Top="9" Width="6" Height="1" Fill="{DynamicResource VsBrush.CommandBarOptionsGlyph}" StrokeThickness="1"/>
<Rectangle Canvas.Left="1.25" Canvas.Top="10.75" Width="6" Height="1" Fill="{DynamicResource VsBrush.CommandBarOptionsGlyph}" StrokeThickness="1"/>
<Rectangle Canvas.Left="1.25" Canvas.Top="12.75" Width="6" Height="1" Fill="{DynamicResource VsBrush.CommandBarOptionsGlyph}" StrokeThickness="1"/>
</Canvas>
</Button>
<Button Margin="2 0" Padding="2" Command="{Binding NextComment}"
Style="{StaticResource GitHubToolbarButton}">
<Button.ToolTip>
<TextBlock FontSize="11" Text="{x:Static ghfvs:Resources.NextComment}"/>
</Button.ToolTip>
<Canvas Width="16" Height="16">
<!-- TODO: Double check these brushes since they don't seem like the right fill colors -->
<Polygon Points="8 8 8 4 4 4 4 8 1 8 6 14 11 8" Fill="{DynamicResource VsBrush.CommandBarOptionsGlyph}" StrokeThickness="1"/>
<Rectangle Canvas.Left="9" Canvas.Top="2" Width="6" Height="1" Fill="{DynamicResource VsBrush.CommandBarOptionsGlyph}" StrokeThickness="1"/>
<Rectangle Canvas.Left="9" Canvas.Top="4" Width="6" Height="1" Fill="{DynamicResource VsBrush.CommandBarOptionsGlyph}" StrokeThickness="1"/>
<Rectangle Canvas.Left="9" Canvas.Top="6" Width="6" Height="1" Fill="{DynamicResource VsBrush.CommandBarOptionsGlyph}" StrokeThickness="1"/>
</Canvas>
</Button>
<Separator Background="{DynamicResource GitHubButtonBorderBrush}" Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
</StackPanel>
</Border>
<ScrollViewer Name="threadScroller"
VerticalScrollBarVisibility="Auto"
Background="{DynamicResource GitHubPeekViewBackground}">
<StackPanel Orientation="Vertical">
<ItemsControl x:Name="annotationsView" ItemsSource="{Binding Annotations}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<ghfvs:InlineAnnotationView />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ghfvs:CommentThreadView x:Name="threadView"
Visibility="{Binding DataContext.AvailableForComment, Converter={ghfvs:BooleanToVisibilityConverter}, ElementName=annotationsView}"
DataContext="{Binding Thread}"/>
</StackPanel>
</ScrollViewer>
</DockPanel>
</UserControl>