-
Notifications
You must be signed in to change notification settings - Fork 107
/
PendingChangesView.xaml
295 lines (264 loc) · 16.2 KB
/
PendingChangesView.xaml
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<UserControl xmlns:my="clr-namespace:GitScc.UI" x:Class="GitScc.PendingChangesView"
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:GitScc"
xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.10.0"
xmlns:vsui="clr-namespace:GitScc.PlatformUI"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="800" KeyDown="UserControl_KeyDown"
Foreground="{DynamicResource {x:Static vsfx:VsBrushes.CommandBarTextActiveKey}}"
Background="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBackgroundKey}}"
Loaded="UserControl_Loaded">
<UserControl.Resources>
<Style x:Key="VerticalGridSplitter" TargetType="{x:Type GridSplitter}">
<Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.CommandBarMenuSeparatorKey}}" />
<Setter Property="Width" Value="3" />
</Style>
<Style x:Key="HorizontalGridSplitter" TargetType="{x:Type GridSplitter}">
<Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.CommandBarMenuSeparatorKey}}" />
<Setter Property="Height" Value="3" />
</Style>
<ControlTemplate x:Key="ListViewItemTemplate2010" TargetType="{x:Type ListViewItem}">
<Border SnapsToDevicePixels="True" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" Margin="{TemplateBinding Margin}">
<GridViewRowPresenter Grid.RowSpan="2" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#3399FF" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.WindowKey}}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True" />
<Condition Property="Selector.IsSelectionActive" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="#F0F0F0" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style x:Key="ListViewItemStyle2010" TargetType="{x:Type ListViewItem}">
<Setter Property="Padding" Value="2" />
<Setter Property="Margin" Value="0" />
<Setter Property="Template" Value="{StaticResource ListViewItemTemplate2010}" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.CommandBarTextActiveKey}}" />
</Style>
<ControlTemplate x:Key="ListViewItemTemplate2012" TargetType="{x:Type ListViewItem}">
<Border SnapsToDevicePixels="True" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" Margin="{TemplateBinding Margin}">
<GridViewRowPresenter Grid.RowSpan="2" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Value="{DynamicResource {x:Static vsui:TreeViewColors.SelectedItemActiveBrushKey}}" Property="Background" />
<Setter Value="{DynamicResource {x:Static vsui:TreeViewColors.SelectedItemActiveTextBrushKey}}" Property="Foreground" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True" />
<Condition Property="Selector.IsSelectionActive" Value="False" />
</MultiTrigger.Conditions>
<Setter Value="{DynamicResource {x:Static vsui:TreeViewColors.SelectedItemInactiveBrushKey}}" Property="Background" />
<Setter Value="{DynamicResource {x:Static vsui:TreeViewColors.SelectedItemInactiveTextBrushKey}}" Property="Foreground" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style x:Key="ListViewItemStyle2012" TargetType="{x:Type ListViewItem}">
<Setter Property="Padding" Value="2" />
<Setter Property="Margin" Value="0" />
<Setter Property="Template" Value="{StaticResource ListViewItemTemplate2012}" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.CommandBarTextActiveKey}}" />
</Style>
<ControlTemplate x:Key="GridViewColumnHeaderGripperTemplate2012" TargetType="{x:Type Thumb}">
<Border Padding="{TemplateBinding Padding}" Background="Transparent">
<Rectangle HorizontalAlignment="Center" Width="1" Fill="{TemplateBinding Background}" />
</Border>
</ControlTemplate>
<Style x:Key="GridViewColumnHeaderGripper2012" TargetType="{x:Type Thumb}">
<Setter Property="Width" Value="8" />
<Setter Property="Background" Value="{DynamicResource {x:Static vsui:HeaderColors.SeparatorLineBrushKey}}" />
<Setter Property="Template" Value="{StaticResource GridViewColumnHeaderGripperTemplate2012}" />
</Style>
<ControlTemplate x:Key="GridViewColumnHeaderTemplate2012" TargetType="{x:Type GridViewColumnHeader}">
<Grid>
<Border Name="HeaderBorder" Padding="{TemplateBinding Padding}" BorderThickness="0,0,0,1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Margin="0">
<ContentPresenter Name="HeaderContent" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<Thumb Name="PART_HeaderGripper" HorizontalAlignment="Right" Margin="0,0,-4,0" Style="{StaticResource GridViewColumnHeaderGripper2012}" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Value="{DynamicResource {x:Static vsui:HeaderColors.MouseOverBrushKey}}" Property="Background" />
<Setter Value="{DynamicResource {x:Static vsui:HeaderColors.MouseOverTextBrushKey}}" Property="Foreground" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Value="{DynamicResource {x:Static vsui:HeaderColors.MouseDownBrushKey}}" Property="Background" />
<Setter Value="{DynamicResource {x:Static vsui:HeaderColors.MouseDownTextBrushKey}}" Property="Foreground" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style x:Key="{x:Type Path}" TargetType="{x:Type Path}">
<Setter Property="Fill" Value="{DynamicResource {x:Static vsui:HeaderColors.GlyphBrushKey}}" />
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsMouseOver,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type GridViewColumnHeader}}}" Value="True">
<Setter Property="Fill" Value="{DynamicResource {x:Static vsui:HeaderColors.MouseOverGlyphBrushKey}}" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=IsPressed,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type GridViewColumnHeader}}}" Value="True">
<Setter Property="Fill" Value="{DynamicResource {x:Static vsui:HeaderColors.MouseDownGlyphBrushKey}}" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="{x:Type ListView}" TargetType="{x:Type ListView}">
<Style.Resources>
<Style TargetType="{x:Type GridViewColumnHeader}">
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Padding" Value="6,4,4,4" />
<Style.Triggers>
<DataTrigger Binding="{Binding Source={x:Static local:GitSccOptions.IsVisualStudio2012}, Mode=OneTime}" Value="True">
<Setter Property="Foreground" Value="{DynamicResource {x:Static vsui:HeaderColors.DefaultTextBrushKey}}" />
<Setter Property="Background" Value="{DynamicResource {x:Static vsui:HeaderColors.DefaultBrushKey}}" />
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static vsui:HeaderColors.SeparatorLineBrushKey}}" />
<Setter Property="Template" Value="{StaticResource GridViewColumnHeaderTemplate2012}" />
</DataTrigger>
</Style.Triggers>
</Style>
</Style.Resources>
<Style.Triggers>
<DataTrigger Binding="{Binding Source={x:Static local:GitSccOptions.IsVisualStudio2012}, Mode=OneTime}" Value="True">
<Setter Property="ItemContainerStyle" Value="{StaticResource ListViewItemStyle2012}" />
</DataTrigger>
<DataTrigger Binding="{Binding Source={x:Static local:GitSccOptions.IsVisualStudio2010}, Mode=OneTime}" Value="True">
<Setter Property="ItemContainerStyle" Value="{StaticResource ListViewItemStyle2010}" />
</DataTrigger>
</Style.Triggers>
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.BackgroundKey}}" />
</Style>
<Style x:Key="{x:Type RichTextBox}" TargetType="{x:Type RichTextBox}">
<Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}" />
<Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.WindowKey}}" />
<Style.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ComboBoxBackgroundKey}}" />
</Trigger>
</Style.Triggers>
</Style>
<DataTemplate x:Key="HeaderTemplateArrowUp">
<DockPanel>
<TextBlock HorizontalAlignment="Center" Text="{Binding}" />
<Path Name="arrow" StrokeThickness="1" Style="{StaticResource {x:Type Path}}" Data="M5,10L15,10 10,5 5,10" />
</DockPanel>
</DataTemplate>
<DataTemplate x:Key="HeaderTemplateArrowDown">
<DockPanel>
<TextBlock HorizontalAlignment="Center" Text="{Binding}" />
<Path Name="arrow" StrokeThickness="1" Style="{StaticResource {x:Type Path}}" Data="M5,5L10,10 15,5 5,5" />
</DockPanel>
</DataTemplate>
</UserControl.Resources>
<Grid x:Name="Main" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Background="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBackgroundKey}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="520" MinWidth="20" MaxWidth="1000" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GridSplitter Grid.Column="1" Grid.Row="0" Grid.RowSpan="2"
VerticalAlignment="Stretch" HorizontalAlignment="Left" Name="gridSplitter1" ResizeDirection="Columns"
Style="{StaticResource VerticalGridSplitter}"/>
<Label Content="Comments:" HorizontalAlignment="Left" Name="label1" VerticalAlignment="Center"
Margin="2,0,0,0" Foreground="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}" />
<CheckBox Content="Sign off" HorizontalAlignment="Right" Margin="0,0,6,0" Name="chkSignOff" VerticalAlignment="Center"
Foreground="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}"/>
<Grid Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="grid1">
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GridSplitter Grid.Row="1" Grid.ColumnSpan="2"
VerticalAlignment="Top" HorizontalAlignment="Stretch" Name="gridSplitter2"
Style="{StaticResource HorizontalGridSplitter}"/>
<Label Content="Changed Files" HorizontalAlignment="Stretch" Name="label3" VerticalAlignment="Center"
Margin="2,0,2,0" Foreground="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}"
Grid.Row="2" ToolTip="select file to commit, or right click to stage/unstage file" />
<RichTextBox HorizontalAlignment="Stretch" Name="textBoxComments" VerticalAlignment="Stretch" Margin="2,0,2,2"
AcceptsReturn="True" VerticalScrollBarVisibility="Visible" SpellCheck.IsEnabled="True">
<RichTextBox.Resources>
<Style TargetType="{x:Type Paragraph}">
<Setter Property="Margin" Value="0"/>
</Style>
</RichTextBox.Resources>
</RichTextBox>
<ListView Name="listView1" Grid.Row="3" SelectionChanged="listView1_SelectionChanged" MouseDoubleClick="listView1_MouseDoubleClick" ContextMenuOpening="listView1_ContextMenuOpening"
SelectedValuePath="FileName" KeyUp="listView1_KeyUp" PreviewKeyDown="listView1_PreviewKeyDown" ButtonBase.Click="listView1_Click" Background="{DynamicResource {x:Static vsfx:VsBrushes.WindowKey}}">
<ListView.View>
<GridView AllowsColumnReorder="False">
<GridViewColumn Width="Auto">
<GridViewColumn.Header>
<GridViewColumnHeader Content="Staged" Tag="Staged" />
</GridViewColumn.Header>
<GridViewColumn.HeaderTemplate>
<DataTemplate>
<CheckBox Name="checkBoxAllStaged" Click="checkBoxAllStaged_Click"
HorizontalAlignment="Left" VerticalAlignment="Center"/>
</DataTemplate>
</GridViewColumn.HeaderTemplate>
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox Name="checkBoxSelected" Click="checkBoxSelected_Click" IsChecked="{Binding IsSelected}"
HorizontalAlignment="Left" VerticalAlignment="Center"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn DisplayMemberBinding="{Binding Status}" Width="Auto">
<GridViewColumn.Header>
<GridViewColumnHeader Content="Status" Tag="Status" />
</GridViewColumn.Header>
</GridViewColumn>
<GridViewColumn DisplayMemberBinding="{Binding FileName}" Width="800">
<GridViewColumn.Header>
<GridViewColumnHeader Content="File" Tag="FileName" />
</GridViewColumn.Header>
</GridViewColumn>
</GridView>
</ListView.View>
<ListView.ContextMenu>
<ContextMenu>
<MenuItem Header="Stage File" Name="menuStage" Click="menuStage_Click" />
<MenuItem Header="Un-Stage File" Name="menuUnstage" Click="menuUnstage_Click" />
<MenuItem Header="Compare..." Name="menuCompare" Click="menuCompare_Click" />
<MenuItem Header="Undo File Changes" Name="menuUndo" Click="menuUndo_Click"/>
<MenuItem Header="Delete File" Name="menuDeleteFile" Click="menuDeleteFile_Click"/>
<MenuItem Header="Ignore file" Name="menuIgnore" Click="menuIgnore_Click" >
<MenuItem Header="Add File to .gitignore" Name="menuIgnoreFile" Click="menuIgnoreFile_Click"/>
<MenuItem Header="Add File Path to .gitignore" Name="menuIgnoreFilePath" Click="menuIgnoreFilePath_Click"/>
<MenuItem Header="Add File Extensions to .gitignore" Name="menuIgnoreFileExt" Click="menuIgnoreFileExt_Click"/>
</MenuItem>
</ContextMenu>
</ListView.ContextMenu>
</ListView>
<Label Content="(If refreshing is slow, try turn off auto-refresh in Tools | Options)" Foreground="#FF333333" Height="28" HorizontalAlignment="Left" Margin="231,0,0,0" Name="label4" VerticalAlignment="Center" Grid.Row="2" Visibility="Collapsed" />
</Grid>
<Grid Grid.Column="2" Grid.Row="0" Grid.RowSpan="2"
Background="{DynamicResource {x:Static vsfx:VsBrushes.WindowKey}}">
<ContentControl x:Name="DiffEditor" MouseDoubleClick="DiffEditor_MouseDoubleClick"></ContentControl>
<!--<TabControl Name="tabControl1">
<TabItem Header="Diff View" Name="tabItem1">
<ContentControl x:Name="DiffEditor" MouseDoubleClick="DiffEditor_MouseDoubleClick"></ContentControl>
</TabItem>
<TabItem Header="Git Console (Experimental)" Name="tabItem2">
<my:GitConsole x:Name="gitConsole1" />
</TabItem>
</TabControl>-->
</Grid>
<my:Settings HorizontalAlignment="Stretch" VerticalAlignment="Stretch" x:Name="Settings" Grid.ColumnSpan="3" Grid.RowSpan="3" Visibility="Collapsed" />
</Grid>
</UserControl>