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-05-28 06:19:53 -07:00
|
|
|
<v:ChangeViewModeSwitcher Grid.Column="0" Width="12" Height="12" 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}"
|
2024-05-28 06:19:53 -07:00
|
|
|
Command="{Binding OpenAssumeUnchanged}">
|
2024-02-05 23:08:37 -08:00
|
|
|
<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-05-28 06:19:53 -07:00
|
|
|
Command="{Binding StageSelected}">
|
2024-04-29 00:22:06 -07:00
|
|
|
<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"
|
2024-05-28 06:19:53 -07:00
|
|
|
ToolTip.Tip="{DynamicResource Text.WorkingCopy.Unstaged.StageAll}"
|
|
|
|
Command="{Binding StageAll}">
|
2024-02-05 23:08:37 -08:00
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.DoubleDown}"/>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
<!-- Unstaged Changes -->
|
2024-05-28 06:19:53 -07:00
|
|
|
<v:ChangeCollectionView Grid.Row="1"
|
|
|
|
IsWorkingCopy="True"
|
|
|
|
SingleSelect="False"
|
|
|
|
Background="{DynamicResource Brush.Contents}"
|
|
|
|
ViewMode="{Binding Source={x:Static vm:Preference.Instance}, Path=UnstagedChangeViewMode}"
|
|
|
|
Changes="{Binding Unstaged}"
|
|
|
|
SelectedChanges="{Binding SelectedUnstaged, Mode=TwoWay}"
|
|
|
|
ContextRequested="OnUnstagedContextRequested"
|
|
|
|
ChangeDoubleTapped="OnUnstagedChangeDoubleTapped"
|
|
|
|
KeyDown="OnUnstagedKeyDown"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
<!-- 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-05-28 06:19:53 -07:00
|
|
|
<v:ChangeViewModeSwitcher Grid.Column="0" Width="12" Height="12" 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-05-28 06:19:53 -07:00
|
|
|
<Button Grid.Column="5" Classes="icon_button" Width="26" Height="14" Padding="0" Command="{Binding UnstageSelected}">
|
2024-04-29 00:22:06 -07:00
|
|
|
<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-05-28 06:19:53 -07:00
|
|
|
<Button Grid.Column="6" Classes="icon_button" Width="26" Height="14" Padding="0" ToolTip.Tip="{DynamicResource Text.WorkingCopy.Staged.UnstageAll}" Command="{Binding UnstageAll}">
|
2024-02-05 23:08:37 -08:00
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.DoubleUp}"/>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
<!-- Staged Changes -->
|
2024-05-28 06:19:53 -07:00
|
|
|
<v:ChangeCollectionView Grid.Row="3"
|
|
|
|
IsWorkingCopy="False"
|
|
|
|
SingleSelect="False"
|
|
|
|
Background="{DynamicResource Brush.Contents}"
|
|
|
|
ViewMode="{Binding Source={x:Static vm:Preference.Instance}, Path=StagedChangeViewMode}"
|
|
|
|
Changes="{Binding Staged}"
|
|
|
|
SelectedChanges="{Binding SelectedStaged, Mode=TwoWay}"
|
|
|
|
ContextRequested="OnStagedContextRequested"
|
|
|
|
ChangeDoubleTapped="OnStagedChangeDoubleTapped"
|
|
|
|
KeyDown="OnStagedKeyDown"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</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}"
|
2024-05-28 06:19:53 -07:00
|
|
|
Content="{DynamicResource Text.WorkingCopy.Amend}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
<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"
|
2024-05-28 06:19:53 -07:00
|
|
|
Command="{Binding Commit}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
<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"
|
2024-05-28 06:19:53 -07:00
|
|
|
Command="{Binding CommitWithPush}">
|
2024-02-05 23:08:37 -08:00
|
|
|
<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>
|