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: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>
|
2024-06-11 01:36:52 -07:00
|
|
|
<ColumnDefinition Width="{Binding Source={x:Static vm:Preference.Instance}, Path=Layout.WorkingCopyLeftWidth, Mode=TwoWay}" 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}}"/>
|
2024-05-30 01:12:28 -07:00
|
|
|
<v:LoadingIcon Grid.Column="3" Width="14" Height="14" 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}"
|
2024-05-31 21:13:57 -07:00
|
|
|
IsChecked="{Binding 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-08-28 07:07:26 -07:00
|
|
|
<TextBlock Margin="16,0,0,0" Text="{OnPlatform Space/Enter, macOS=␣/Enter}" 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"
|
2024-07-17 01:56:16 -07:00
|
|
|
IsUnstagedChange="True"
|
2024-07-12 02:14:52 -07:00
|
|
|
SelectionMode="Multiple"
|
2024-05-28 06:19:53 -07:00
|
|
|
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}}"/>
|
2024-05-30 01:12:28 -07:00
|
|
|
<v:LoadingIcon Grid.Column="3" Width="14" Height="14" 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-08-28 07:07:26 -07:00
|
|
|
<TextBlock Margin="16,0,0,0" Text="{OnPlatform Space/Enter, macOS=␣/Enter}" 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"
|
2024-07-12 02:14:52 -07:00
|
|
|
SelectionMode="Multiple"
|
2024-05-28 06:19:53 -07:00
|
|
|
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-06-27 04:34:04 -07:00
|
|
|
<Grid Grid.Column="2" Margin="0,4,4,4">
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="*" MinHeight="400"/>
|
|
|
|
<RowDefinition Height="4"/>
|
|
|
|
<RowDefinition Height="128" MinHeight="100"/>
|
|
|
|
<RowDefinition Height="36"/>
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
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>
|
|
|
|
|
2024-06-23 18:39:55 -07:00
|
|
|
<!-- Splitter -->
|
|
|
|
<GridSplitter Grid.Row="1" MinHeight="1"
|
|
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
|
|
|
Background="Transparent"/>
|
|
|
|
|
2024-02-05 23:08:37 -08:00
|
|
|
<!-- Commit Message -->
|
2024-06-23 18:39:55 -07:00
|
|
|
<v:CommitMessageTextBox Grid.Row="2" Text="{Binding CommitMessage, Mode=TwoWay}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
<!-- Commit Options -->
|
2024-07-06 19:28:14 -07:00
|
|
|
<Grid Grid.Row="3" Margin="0,6,0,0" ColumnDefinitions="Auto,Auto,Auto,*,Auto,Auto,Auto">
|
2024-02-05 23:08:37 -08:00
|
|
|
<Button Grid.Column="0"
|
2024-08-15 04:52:05 -07:00
|
|
|
Classes="no_border"
|
2024-08-15 03:59:35 -07:00
|
|
|
Margin="4,0,0,0" Padding="0"
|
|
|
|
Click="OnOpenCommitMessagePicker">
|
2024-08-15 04:52:05 -07:00
|
|
|
<Grid ColumnDefinitions="Auto,*">
|
|
|
|
<Path Grid.Column="0" Width="12" Height="12" Data="{StaticResource Icons.Menu}"/>
|
|
|
|
<TextBlock Grid.Column="1" Margin="8,0,0,0" Text="{DynamicResource Text.WorkingCopy.CommitMessageHelper}"/>
|
|
|
|
</Grid>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Button>
|
|
|
|
|
|
|
|
<CheckBox Grid.Column="1"
|
2024-07-06 19:28:14 -07:00
|
|
|
Height="24"
|
|
|
|
Margin="12,0,0,0"
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
IsChecked="{Binding AutoStageBeforeCommit, Mode=TwoWay}"
|
2024-08-15 05:09:38 -07:00
|
|
|
Content="{DynamicResource Text.WorkingCopy.AutoStage}"/>
|
2024-07-06 19:28:14 -07:00
|
|
|
|
|
|
|
<CheckBox Grid.Column="2"
|
2024-02-05 23:08:37 -08:00
|
|
|
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
|
|
|
|
2024-07-06 19:28:14 -07:00
|
|
|
<v:LoadingIcon Grid.Column="4" Width="18" Height="18" IsVisible="{Binding IsCommitting}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
2024-07-06 19:28:14 -07:00
|
|
|
<Button Grid.Column="5"
|
2024-02-05 23:08:37 -08:00
|
|
|
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-06-13 05:39:10 -07:00
|
|
|
Command="{Binding Commit}"
|
|
|
|
HotKey="{OnPlatform Ctrl+Enter, macOS=⌘+Enter}"
|
|
|
|
ToolTip.Tip="{OnPlatform Ctrl+Enter, macOS=⌘+Enter}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
2024-07-06 19:28:14 -07:00
|
|
|
<Button Grid.Column="6"
|
2024-02-05 23:08:37 -08:00
|
|
|
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-30 00:13:59 -07:00
|
|
|
Command="{Binding CommitWithPush}"
|
2024-06-13 05:39:10 -07:00
|
|
|
HotKey="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+Shift+Enter}"
|
|
|
|
ToolTip.Tip="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+Shift+Enter}"
|
2024-05-30 00:13:59 -07:00
|
|
|
IsVisible="{Binding IsCommitWithPushVisible}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</UserControl>
|