2024-02-05 23:08:37 -08:00
|
|
|
<UserControl xmlns="https://github.com/avaloniaui"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
xmlns:m="using:SourceGit.Models"
|
|
|
|
xmlns:vm="using:SourceGit.ViewModels"
|
|
|
|
xmlns:v="using:SourceGit.Views"
|
|
|
|
xmlns:c="using:SourceGit.Converters"
|
|
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
|
|
x:Class="SourceGit.Views.WorkingCopy"
|
|
|
|
x:DataType="vm:WorkingCopy">
|
|
|
|
<Grid>
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="300" MinWidth="300"/>
|
2024-03-26 00:18:34 -07:00
|
|
|
<ColumnDefinition Width="5"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
<!-- Left -->
|
|
|
|
<Grid Grid.Column="0" RowDefinitions="28,*,28,*">
|
|
|
|
<!-- Unstaged Toolbar -->
|
|
|
|
<Border Grid.Row="0" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border0}">
|
2024-04-11 19:03:24 -07:00
|
|
|
<Grid ColumnDefinitions="Auto,Auto,Auto,Auto,*,Auto,Auto,Auto,Auto">
|
2024-02-05 23:08:37 -08:00
|
|
|
<v:ChangeViewModeSwitcher Grid.Column="0" Width="14" Height="14" Margin="8,0,0,0" ViewMode="{Binding Source={x:Static vm:Preference.Instance}, Path=UnstagedChangeViewMode, Mode=TwoWay}"/>
|
2024-04-11 19:03:24 -07:00
|
|
|
<TextBlock Grid.Column="1" Text="{DynamicResource Text.WorkingCopy.Unstaged}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold" Margin="8,0,0,0"/>
|
|
|
|
<TextBlock Grid.Column="2" FontWeight="Bold" Foreground="{DynamicResource Brush.FG2}" Text="{Binding Unstaged, Converter={x:Static c:ListConverters.ToCount}}"/>
|
|
|
|
<Path Grid.Column="3" Classes="rotating" Width="14" Height="14" Data="{StaticResource Icons.Loading}" Margin="8,0,0,0" IsVisible="{Binding IsStaging}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
2024-04-11 19:03:24 -07:00
|
|
|
<Button Grid.Column="5"
|
2024-02-05 23:08:37 -08:00
|
|
|
Classes="icon_button"
|
|
|
|
Width="26" Height="14"
|
|
|
|
Padding="0"
|
|
|
|
ToolTip.Tip="{DynamicResource Text.WorkingCopy.Unstaged.ViewAssumeUnchaged}"
|
|
|
|
Click="ViewAssumeUnchanged">
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.File.Ignore}"/>
|
|
|
|
</Button>
|
2024-04-11 19:03:24 -07:00
|
|
|
<ToggleButton Grid.Column="6"
|
2024-02-05 23:08:37 -08:00
|
|
|
Classes="toggle_untracked"
|
|
|
|
Width="26" Height="14"
|
|
|
|
ToolTip.Tip="{DynamicResource Text.WorkingCopy.IncludeUntracked}"
|
|
|
|
IsChecked="{Binding $parent[v:Repository].DataContext.(vm:Repository).IncludeUntracked, Mode=TwoWay}"/>
|
2024-04-11 19:03:24 -07:00
|
|
|
<Button Grid.Column="7"
|
2024-02-05 23:08:37 -08:00
|
|
|
Classes="icon_button"
|
|
|
|
Width="26" Height="14"
|
|
|
|
Padding="0"
|
2024-04-29 00:22:06 -07:00
|
|
|
Click="StageSelected">
|
|
|
|
<ToolTip.Tip>
|
|
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
|
|
<TextBlock Text="{DynamicResource Text.WorkingCopy.Unstaged.Stage}" VerticalAlignment="Center"/>
|
2024-05-05 03:31:11 -07:00
|
|
|
<TextBlock Margin="16,0,0,0" Text="{OnPlatform Space, macOS=␣}" Opacity=".6" FontSize="11" VerticalAlignment="Center"/>
|
2024-04-29 00:22:06 -07:00
|
|
|
</StackPanel>
|
|
|
|
</ToolTip.Tip>
|
2024-02-05 23:08:37 -08:00
|
|
|
<Path Width="14" Height="14" Margin="0,6,0,0" Data="{StaticResource Icons.Down}"/>
|
|
|
|
</Button>
|
2024-04-11 19:03:24 -07:00
|
|
|
<Button Grid.Column="8"
|
2024-02-05 23:08:37 -08:00
|
|
|
Classes="icon_button"
|
|
|
|
Width="26" Height="14"
|
|
|
|
Padding="0"
|
|
|
|
ToolTip.Tip="{DynamicResource Text.WorkingCopy.Unstaged.StageAll}" Click="StageAll">
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.DoubleDown}"/>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
<!-- Unstaged Changes -->
|
|
|
|
<Grid Grid.Row="1" Background="{DynamicResource Brush.Contents}">
|
|
|
|
<DataGrid x:Name="unstagedList"
|
|
|
|
Background="Transparent"
|
|
|
|
ItemsSource="{Binding Unstaged}"
|
2024-02-27 02:26:05 -08:00
|
|
|
SelectedItem="{Binding SelectedUnstagedChange, Mode=TwoWay}"
|
2024-02-05 23:08:37 -08:00
|
|
|
SelectionMode="Extended"
|
|
|
|
CanUserReorderColumns="False"
|
|
|
|
CanUserResizeColumns="False"
|
|
|
|
CanUserSortColumns="False"
|
|
|
|
IsReadOnly="True"
|
|
|
|
HeadersVisibility="None"
|
|
|
|
Focusable="False"
|
|
|
|
RowHeight="26"
|
|
|
|
HorizontalScrollBarVisibility="Auto"
|
|
|
|
VerticalScrollBarVisibility="Auto"
|
|
|
|
KeyDown="OnUnstagedListKeyDown"
|
|
|
|
ContextRequested="OnUnstagedListContextRequested"
|
|
|
|
IsVisible="{Binding Source={x:Static vm:Preference.Instance}, Path=UnstagedChangeViewMode, Converter={x:Static c:ChangeViewModeConverters.IsList}}">
|
|
|
|
<DataGrid.Columns>
|
|
|
|
<DataGridTemplateColumn Header="ICON">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate>
|
2024-03-04 23:53:38 -08:00
|
|
|
<v:ChangeStatusIcon Width="14" Height="14" IsWorkingCopyChange="True" Change="{Binding}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
|
|
<DataGridTemplateColumn Width="*" Header="PATH">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate>
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Classes="monospace" Text="{Binding Path}" Margin="4,0,0,0"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
</DataGrid.Columns>
|
|
|
|
</DataGrid>
|
|
|
|
|
|
|
|
<DataGrid x:Name="unstagedGrid"
|
|
|
|
Background="Transparent"
|
|
|
|
ItemsSource="{Binding Unstaged}"
|
2024-02-27 02:26:05 -08:00
|
|
|
SelectedItem="{Binding SelectedUnstagedChange, Mode=TwoWay}"
|
2024-02-05 23:08:37 -08:00
|
|
|
SelectionMode="Extended"
|
|
|
|
CanUserReorderColumns="False"
|
|
|
|
CanUserResizeColumns="False"
|
|
|
|
CanUserSortColumns="False"
|
|
|
|
IsReadOnly="True"
|
|
|
|
HeadersVisibility="None"
|
|
|
|
Focusable="False"
|
|
|
|
RowHeight="26"
|
|
|
|
HorizontalScrollBarVisibility="Auto"
|
|
|
|
VerticalScrollBarVisibility="Auto"
|
|
|
|
KeyDown="OnUnstagedListKeyDown"
|
|
|
|
ContextRequested="OnUnstagedListContextRequested"
|
|
|
|
IsVisible="{Binding Source={x:Static vm:Preference.Instance}, Path=UnstagedChangeViewMode, Converter={x:Static c:ChangeViewModeConverters.IsGrid}}">
|
|
|
|
<DataGrid.Columns>
|
|
|
|
<DataGridTemplateColumn Header="ICON">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate>
|
2024-03-04 23:53:38 -08:00
|
|
|
<v:ChangeStatusIcon Width="14" Height="14" IsWorkingCopyChange="True" Change="{Binding}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
|
|
<DataGridTemplateColumn Header="FILE_NAME">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate>
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Classes="monospace" Text="{Binding Path, Converter={x:Static c:PathConverters.PureFileName}}" Margin="4,0,0,0"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
|
|
<DataGridTemplateColumn Header="FOLDER_PATH">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate>
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Classes="monospace" Text="{Binding Path, Converter={x:Static c:PathConverters.PureDirectoryName}}" Margin="4,0,0,0" Foreground="{DynamicResource Brush.FG2}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
</DataGrid.Columns>
|
|
|
|
</DataGrid>
|
|
|
|
|
|
|
|
<TreeView x:Name="unstagedTree"
|
|
|
|
ItemsSource="{Binding UnstagedTree}"
|
2024-02-27 02:26:05 -08:00
|
|
|
SelectedItem="{Binding SelectedUnstagedTreeNode, Mode=TwoWay}"
|
2024-02-05 23:08:37 -08:00
|
|
|
SelectionMode="Multiple"
|
|
|
|
AutoScrollToSelectedItem="True"
|
|
|
|
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
|
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
|
|
|
KeyDown="OnUnstagedTreeViewKeyDown"
|
|
|
|
ContextRequested="OnUnstagedTreeViewContextRequested"
|
|
|
|
IsVisible="{Binding Source={x:Static vm:Preference.Instance}, Path=UnstagedChangeViewMode, Converter={x:Static c:ChangeViewModeConverters.IsTree}}">
|
|
|
|
<TreeView.Styles>
|
|
|
|
<Style Selector="TreeViewItem" x:DataType="vm:FileTreeNode">
|
|
|
|
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
|
|
|
|
</Style>
|
|
|
|
</TreeView.Styles>
|
|
|
|
|
|
|
|
<TreeView.ItemTemplate>
|
|
|
|
<TreeDataTemplate ItemsSource="{Binding Children}" x:DataType="{x:Type vm:FileTreeNode}">
|
|
|
|
<Grid Height="24" ColumnDefinitions="Auto,*">
|
|
|
|
<Path Grid.Column="0" Classes="folder_icon" Width="14" Height="14" Margin="0,2,0,0" IsVisible="{Binding IsFolder}" Fill="Goldenrod" VerticalAlignment="Center"/>
|
2024-03-04 23:53:38 -08:00
|
|
|
<v:ChangeStatusIcon Grid.Column="0" Width="14" Height="14" IsWorkingCopyChange="True" Change="{Binding Backend}" IsVisible="{Binding !IsFolder}"/>
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Grid.Column="1" Classes="monospace" Text="{Binding FullPath, Converter={x:Static c:PathConverters.PureFileName}}" Margin="6,0,0,0"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Grid>
|
|
|
|
</TreeDataTemplate>
|
|
|
|
</TreeView.ItemTemplate>
|
|
|
|
</TreeView>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<!-- Staged Toolbar -->
|
|
|
|
<Border Grid.Row="2" BorderThickness="0,1" BorderBrush="{DynamicResource Brush.Border0}">
|
2024-04-11 19:03:24 -07:00
|
|
|
<Grid ColumnDefinitions="Auto,Auto,Auto,Auto,*,Auto,Auto">
|
2024-02-05 23:08:37 -08:00
|
|
|
<v:ChangeViewModeSwitcher Grid.Column="0" Width="14" Height="14" Margin="8,0,0,0" ViewMode="{Binding Source={x:Static vm:Preference.Instance}, Path=StagedChangeViewMode, Mode=TwoWay}"/>
|
2024-04-11 19:03:24 -07:00
|
|
|
<TextBlock Grid.Column="1" Text="{DynamicResource Text.WorkingCopy.Staged}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold" Margin="8,0,0,0"/>
|
|
|
|
<TextBlock Grid.Column="2" FontWeight="Bold" Foreground="{DynamicResource Brush.FG2}" Text="{Binding Staged, Converter={x:Static c:ListConverters.ToCount}}"/>
|
|
|
|
<Path Grid.Column="3" Classes="rotating" Width="14" Height="14" Data="{StaticResource Icons.Loading}" Margin="8,0,0,0" IsVisible="{Binding IsUnstaging}"/>
|
2024-04-29 00:22:06 -07:00
|
|
|
<Button Grid.Column="5" Classes="icon_button" Width="26" Height="14" Padding="0" Click="UnstageSelected">
|
|
|
|
<ToolTip.Tip>
|
|
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
|
|
<TextBlock Text="{DynamicResource Text.WorkingCopy.Staged.Unstage}" VerticalAlignment="Center"/>
|
2024-05-05 03:31:11 -07:00
|
|
|
<TextBlock Margin="16,0,0,0" Text="{OnPlatform Space, macOS=␣}" Opacity=".6" FontSize="11" VerticalAlignment="Center"/>
|
2024-04-29 00:22:06 -07:00
|
|
|
</StackPanel>
|
|
|
|
</ToolTip.Tip>
|
2024-02-05 23:08:37 -08:00
|
|
|
<Path Width="14" Height="14" Margin="0,6,0,0" Data="{StaticResource Icons.Up}"/>
|
|
|
|
</Button>
|
2024-04-11 19:03:24 -07:00
|
|
|
<Button Grid.Column="6" Classes="icon_button" Width="26" Height="14" Padding="0" ToolTip.Tip="{DynamicResource Text.WorkingCopy.Staged.UnstageAll}" Click="UnstageAll">
|
2024-02-05 23:08:37 -08:00
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.DoubleUp}"/>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
<!-- Staged Changes -->
|
|
|
|
<Grid Grid.Row="3" Background="{DynamicResource Brush.Contents}">
|
|
|
|
<DataGrid x:Name="stagedList"
|
|
|
|
Background="Transparent"
|
2024-04-11 05:50:19 -07:00
|
|
|
ItemsSource="{Binding Staged}"
|
2024-02-27 02:26:05 -08:00
|
|
|
SelectedItem="{Binding SelectedStagedChange, Mode=TwoWay}"
|
2024-04-11 05:50:19 -07:00
|
|
|
SelectionMode="Extended"
|
|
|
|
CanUserReorderColumns="False"
|
|
|
|
CanUserResizeColumns="False"
|
|
|
|
CanUserSortColumns="False"
|
|
|
|
IsReadOnly="True"
|
|
|
|
HeadersVisibility="None"
|
|
|
|
Focusable="False"
|
|
|
|
RowHeight="26"
|
|
|
|
HorizontalScrollBarVisibility="Auto"
|
|
|
|
VerticalScrollBarVisibility="Auto"
|
2024-02-05 23:08:37 -08:00
|
|
|
KeyDown="OnStagedListKeyDown"
|
|
|
|
ContextRequested="OnStagedListContextRequested"
|
2024-04-11 05:50:19 -07:00
|
|
|
IsVisible="{Binding Source={x:Static vm:Preference.Instance}, Path=StagedChangeViewMode, Converter={x:Static c:ChangeViewModeConverters.IsList}}">
|
2024-02-05 23:08:37 -08:00
|
|
|
<DataGrid.Columns>
|
|
|
|
<DataGridTemplateColumn Header="ICON">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate>
|
2024-03-04 23:53:38 -08:00
|
|
|
<v:ChangeStatusIcon Width="14" Height="14" IsWorkingCopyChange="False" Change="{Binding}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
|
|
<DataGridTemplateColumn Width="*" Header="PATH">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate>
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Classes="monospace" Text="{Binding Path}" Margin="4,0,0,0"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
</DataGrid.Columns>
|
|
|
|
</DataGrid>
|
|
|
|
|
|
|
|
<DataGrid x:Name="stagedGrid"
|
|
|
|
Background="Transparent"
|
|
|
|
ItemsSource="{Binding Staged}"
|
2024-02-27 02:26:05 -08:00
|
|
|
SelectedItem="{Binding SelectedStagedChange, Mode=TwoWay}"
|
2024-02-05 23:08:37 -08:00
|
|
|
SelectionMode="Extended"
|
|
|
|
CanUserReorderColumns="False"
|
|
|
|
CanUserResizeColumns="False"
|
|
|
|
CanUserSortColumns="False"
|
|
|
|
IsReadOnly="True"
|
|
|
|
HeadersVisibility="None"
|
|
|
|
Focusable="False"
|
|
|
|
RowHeight="26"
|
|
|
|
HorizontalScrollBarVisibility="Auto"
|
|
|
|
VerticalScrollBarVisibility="Auto"
|
|
|
|
KeyDown="OnStagedListKeyDown"
|
|
|
|
ContextRequested="OnStagedListContextRequested"
|
|
|
|
IsVisible="{Binding Source={x:Static vm:Preference.Instance}, Path=StagedChangeViewMode, Converter={x:Static c:ChangeViewModeConverters.IsGrid}}">
|
|
|
|
<DataGrid.Columns>
|
|
|
|
<DataGridTemplateColumn Header="ICON">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate>
|
2024-03-04 23:53:38 -08:00
|
|
|
<v:ChangeStatusIcon Width="14" Height="14" IsWorkingCopyChange="False" Change="{Binding}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
|
|
<DataGridTemplateColumn Header="FILE_NAME">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate>
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Classes="monospace" Text="{Binding Path, Converter={x:Static c:PathConverters.PureFileName}}" Margin="4,0,0,0"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
|
|
<DataGridTemplateColumn Header="FOLDER_PATH">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate>
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Classes="monospace" Text="{Binding Path, Converter={x:Static c:PathConverters.PureDirectoryName}}" Margin="4,0,0,0" Foreground="{DynamicResource Brush.FG2}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
</DataGrid.Columns>
|
|
|
|
</DataGrid>
|
|
|
|
|
|
|
|
<TreeView x:Name="stagedTree"
|
|
|
|
ItemsSource="{Binding StagedTree}"
|
2024-02-27 02:26:05 -08:00
|
|
|
SelectedItem="{Binding SelectedStagedTreeNode, Mode=TwoWay}"
|
2024-02-05 23:08:37 -08:00
|
|
|
SelectionMode="Multiple"
|
|
|
|
AutoScrollToSelectedItem="True"
|
|
|
|
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
|
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
|
|
|
KeyDown="OnStagedTreeViewKeyDown"
|
|
|
|
ContextRequested="OnStagedTreeViewContextRequested"
|
|
|
|
IsVisible="{Binding Source={x:Static vm:Preference.Instance}, Path=StagedChangeViewMode, Converter={x:Static c:ChangeViewModeConverters.IsTree}}">
|
|
|
|
<TreeView.Styles>
|
|
|
|
<Style Selector="TreeViewItem" x:DataType="vm:FileTreeNode">
|
|
|
|
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
|
|
|
|
</Style>
|
|
|
|
</TreeView.Styles>
|
|
|
|
|
|
|
|
<TreeView.ItemTemplate>
|
|
|
|
<TreeDataTemplate ItemsSource="{Binding Children}" x:DataType="{x:Type vm:FileTreeNode}">
|
|
|
|
<Grid Height="24" ColumnDefinitions="Auto,*">
|
|
|
|
<Path Grid.Column="0" Classes="folder_icon" Width="14" Height="14" Margin="0,2,0,0" IsVisible="{Binding IsFolder}" Fill="Goldenrod" VerticalAlignment="Center"/>
|
2024-03-04 23:53:38 -08:00
|
|
|
<v:ChangeStatusIcon Grid.Column="0" Width="14" Height="14" IsWorkingCopyChange="False" Change="{Binding Backend}" IsVisible="{Binding !IsFolder}"/>
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Grid.Column="1" Classes="monospace" Text="{Binding FullPath, Converter={x:Static c:PathConverters.PureFileName}}" Margin="6,0,0,0"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Grid>
|
|
|
|
</TreeDataTemplate>
|
|
|
|
</TreeView.ItemTemplate>
|
|
|
|
</TreeView>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<GridSplitter Grid.Column="1"
|
2024-03-26 00:18:34 -07:00
|
|
|
MinWidth="1"
|
|
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
|
|
|
Background="Transparent"
|
|
|
|
BorderThickness="1,0,0,0"
|
|
|
|
BorderBrush="{DynamicResource Brush.Border0}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
<!-- Right -->
|
2024-03-26 00:18:34 -07:00
|
|
|
<Grid Grid.Column="2" Margin="0,4,4,4" RowDefinitions="*,Auto,32">
|
2024-02-05 23:08:37 -08:00
|
|
|
<!-- Select Change Detail -->
|
|
|
|
<Grid Grid.Row="0">
|
|
|
|
<Border BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
|
|
|
|
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
|
|
|
|
<Path Width="64" Height="64" Data="{StaticResource Icons.Diff}" Fill="{DynamicResource Brush.FG2}"/>
|
|
|
|
<TextBlock Margin="0,16,0,0"
|
|
|
|
Text="{DynamicResource Text.Diff.Welcome}"
|
|
|
|
FontSize="18" FontWeight="Bold"
|
|
|
|
Foreground="{DynamicResource Brush.FG2}"
|
|
|
|
HorizontalAlignment="Center"/>
|
|
|
|
</StackPanel>
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
<ContentControl Content="{Binding DetailContext}">
|
|
|
|
<ContentControl.DataTemplates>
|
|
|
|
<DataTemplate DataType="vm:ConflictContext">
|
|
|
|
<Border Background="{DynamicResource Brush.Window}" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
|
2024-04-28 19:54:29 -07:00
|
|
|
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
|
|
<StackPanel Orientation="Vertical" IsVisible="{Binding !IsResolved}">
|
|
|
|
<Path Width="64" Height="64" Data="{StaticResource Icons.Conflict}" Fill="{DynamicResource Brush.FG2}"/>
|
|
|
|
<TextBlock Margin="0,16,0,8" FontSize="20" FontWeight="Bold" Text="{DynamicResource Text.WorkingCopy.Conflicts}" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/>
|
|
|
|
<TextBlock Text="{DynamicResource Text.WorkingCopy.ResolveTip}" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/>
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
<StackPanel Orientation="Vertical" IsVisible="{Binding IsResolved}">
|
|
|
|
<Path Width="64" Height="64" Data="{StaticResource Icons.Check}" Fill="Green"/>
|
|
|
|
<TextBlock Margin="0,16,0,8" FontSize="20" FontWeight="Bold" Text="{DynamicResource Text.WorkingCopy.Conflicts.Resolved}" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/>
|
|
|
|
<TextBlock Text="{DynamicResource Text.WorkingCopy.CanStageTip}" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/>
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Border>
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
|
|
<DataTemplate DataType="vm:DiffContext">
|
|
|
|
<v:DiffView/>
|
|
|
|
</DataTemplate>
|
|
|
|
</ContentControl.DataTemplates>
|
|
|
|
</ContentControl>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<!-- Commit Message -->
|
|
|
|
<TextBox Grid.Row="1"
|
|
|
|
Height="80"
|
|
|
|
Margin="0,4" Padding="2,1"
|
|
|
|
AcceptsReturn="True" AcceptsTab="True"
|
|
|
|
TextWrapping="Wrap"
|
|
|
|
VerticalContentAlignment="Top"
|
|
|
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
|
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
|
|
|
Background="{DynamicResource Brush.Contents}"
|
|
|
|
BorderThickness="1"
|
|
|
|
BorderBrush="{DynamicResource Brush.Border2}"
|
|
|
|
Watermark="{DynamicResource Text.WorkingCopy.CommitMessageTip}"
|
|
|
|
Text="{Binding CommitMessage, Mode=TwoWay}"/>
|
|
|
|
|
|
|
|
<!-- Commit Options -->
|
|
|
|
<Grid Grid.Row="2" ColumnDefinitions="Auto,Auto,*,Auto,Auto,Auto">
|
|
|
|
<Button Grid.Column="0"
|
|
|
|
Classes="icon_button"
|
|
|
|
Width="14" Height="14"
|
2024-02-17 23:44:05 -08:00
|
|
|
Click="OnOpenCommitMessagePicker"
|
2024-02-05 23:08:37 -08:00
|
|
|
ToolTip.Tip="{DynamicResource Text.WorkingCopy.MessageHistories}">
|
|
|
|
<Path Width="14" Height="14" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.List}"/>
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<CheckBox Grid.Column="1"
|
|
|
|
Height="24"
|
|
|
|
Margin="12,0,0,0"
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
IsChecked="{Binding UseAmend, Mode=TwoWay}"
|
|
|
|
Content="{DynamicResource Text.WorkingCopy.Amend}"
|
|
|
|
Checked="StartAmend"/>
|
|
|
|
|
|
|
|
<Path Grid.Column="3"
|
|
|
|
Classes="rotating"
|
|
|
|
Width="18" Height="18"
|
|
|
|
Data="{StaticResource Icons.Loading}"
|
|
|
|
IsVisible="{Binding IsCommitting}"/>
|
|
|
|
|
|
|
|
<Button Grid.Column="4"
|
|
|
|
Classes="flat primary"
|
|
|
|
Content="{DynamicResource Text.WorkingCopy.Commit}"
|
2024-03-07 23:52:40 -08:00
|
|
|
Height="28"
|
2024-02-05 23:08:37 -08:00
|
|
|
Margin="8,0,0,0"
|
|
|
|
Padding="8,0"
|
|
|
|
Click="Commit"/>
|
|
|
|
|
|
|
|
<Button Grid.Column="5"
|
|
|
|
Classes="flat"
|
|
|
|
Content="{DynamicResource Text.WorkingCopy.CommitAndPush}"
|
2024-03-07 23:52:40 -08:00
|
|
|
Height="28"
|
2024-02-05 23:08:37 -08:00
|
|
|
Margin="8,0,0,0"
|
|
|
|
Padding="8,0"
|
|
|
|
Click="CommitWithPush">
|
|
|
|
<Button.IsVisible>
|
|
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
|
|
<Binding Path="$parent[v:Repository].DataContext.(vm:Repository).CanCommitWithPush"/>
|
|
|
|
<Binding Path="!UseAmend"/>
|
|
|
|
</MultiBinding>
|
|
|
|
</Button.IsVisible>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</UserControl>
|