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.StashesPage"
|
|
|
|
x:DataType="vm:StashesPage">
|
|
|
|
<Grid>
|
|
|
|
<Grid.ColumnDefinitions>
|
2024-06-11 01:36:52 -07:00
|
|
|
<ColumnDefinition Width="{Binding Source={x:Static vm:Preference.Instance}, Path=Layout.StashesLeftWidth, Mode=TwoWay}" MinWidth="300"/>
|
2024-03-26 00:18:34 -07:00
|
|
|
<ColumnDefinition Width="4"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
<!-- Left -->
|
2024-06-28 03:57:56 -07:00
|
|
|
<Grid Grid.Column="0" RowDefinitions="28,36,*,28,*">
|
2024-02-05 23:08:37 -08:00
|
|
|
<!-- Stash Bar -->
|
2024-06-28 03:57:56 -07:00
|
|
|
<Grid Grid.Row="0" ColumnDefinitions="Auto,Auto,Auto,*,Auto">
|
|
|
|
<Path Grid.Column="0" Margin="8,0,0,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.Stashes}"/>
|
|
|
|
<TextBlock Grid.Column="1" Text="{DynamicResource Text.Stashes.Stashes}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold" Margin="8,0,0,0"/>
|
|
|
|
<TextBlock Grid.Column="2" Text="{Binding Stashes, Converter={x:Static c:ListConverters.ToCount}}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
|
|
|
|
<Button Grid.Column="4"
|
|
|
|
Classes="icon_button"
|
|
|
|
Width="26" Height="14"
|
|
|
|
Padding="0"
|
|
|
|
Command="{Binding Clear}"
|
|
|
|
IsEnabled="{Binding Stashes.Count, Converter={x:Static c:IntConverters.IsGreaterThanZero}}">
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Clean}"/>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<!-- Search Bar -->
|
|
|
|
<Border Grid.Row="1" BorderThickness="0,1" BorderBrush="{DynamicResource Brush.Border0}">
|
2024-07-14 00:55:15 -07:00
|
|
|
<TextBox Height="24"
|
2024-06-28 03:57:56 -07:00
|
|
|
Margin="4,0"
|
|
|
|
BorderThickness="1"
|
|
|
|
CornerRadius="12"
|
|
|
|
Text="{Binding SearchFilter, Mode=TwoWay}"
|
|
|
|
BorderBrush="{DynamicResource Brush.Border2}"
|
|
|
|
VerticalContentAlignment="Center">
|
|
|
|
<TextBox.InnerLeftContent>
|
|
|
|
<Path Width="14" Height="14"
|
|
|
|
Margin="6,0,0,0"
|
|
|
|
Fill="{DynamicResource Brush.FG2}"
|
|
|
|
Data="{StaticResource Icons.Search}"/>
|
|
|
|
</TextBox.InnerLeftContent>
|
|
|
|
|
|
|
|
<TextBox.InnerRightContent>
|
|
|
|
<Button Classes="icon_button"
|
|
|
|
Width="16"
|
|
|
|
Margin="0,0,6,0"
|
|
|
|
Command="{Binding ClearSearchFilter}"
|
|
|
|
IsVisible="{Binding SearchFilter, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
|
|
|
HorizontalAlignment="Right">
|
|
|
|
<Path Width="14" Height="14"
|
|
|
|
Margin="0,1,0,0"
|
|
|
|
Fill="{DynamicResource Brush.FG1}"
|
|
|
|
Data="{StaticResource Icons.Clear}"/>
|
|
|
|
</Button>
|
|
|
|
</TextBox.InnerRightContent>
|
|
|
|
</TextBox>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Border>
|
|
|
|
|
|
|
|
<!-- Stash List -->
|
2024-06-28 03:57:56 -07:00
|
|
|
<DataGrid Grid.Row="2"
|
2024-02-05 23:08:37 -08:00
|
|
|
Background="{DynamicResource Brush.Contents}"
|
2024-06-28 03:57:56 -07:00
|
|
|
ItemsSource="{Binding VisibleStashes}"
|
2024-02-05 23:08:37 -08:00
|
|
|
SelectedItem="{Binding SelectedStash, Mode=TwoWay}"
|
2024-04-02 01:23:47 -07:00
|
|
|
SelectionMode="Single"
|
|
|
|
CanUserReorderColumns="False"
|
|
|
|
CanUserResizeColumns="False"
|
|
|
|
CanUserSortColumns="False"
|
|
|
|
IsReadOnly="True"
|
|
|
|
HeadersVisibility="None"
|
|
|
|
Focusable="False"
|
|
|
|
RowHeight="50"
|
|
|
|
HorizontalScrollBarVisibility="Disabled"
|
|
|
|
VerticalScrollBarVisibility="Auto">
|
2024-02-05 23:08:37 -08:00
|
|
|
<DataGrid.Columns>
|
|
|
|
<DataGridTemplateColumn Width="*">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate DataType="m:Stash">
|
2024-05-30 00:13:59 -07:00
|
|
|
<Border BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="0,0,0,1" Padding="4" Background="Transparent" ContextRequested="OnStashContextRequested">
|
2024-02-05 23:08:37 -08:00
|
|
|
<Grid RowDefinitions="Auto,*" >
|
|
|
|
<Grid Grid.Row="0" ColumnDefinitions="*,Auto">
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Grid.Column="0" Classes="monospace" Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" TextDecorations="Underline" Cursor="Hand"/>
|
|
|
|
<TextBlock Grid.Column="1" Classes="monospace" Text="{Binding TimeStr}" Foreground="{DynamicResource Brush.FG2}" Margin="8,0,0,0"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Grid>
|
|
|
|
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Grid.Row="1" Classes="monospace" Text="{Binding Message}" VerticalAlignment="Bottom"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
</DataGrid.Columns>
|
|
|
|
</DataGrid>
|
|
|
|
|
|
|
|
<!-- Changes Bar -->
|
2024-06-28 03:57:56 -07:00
|
|
|
<Border Grid.Row="3" BorderThickness="0,1" BorderBrush="{DynamicResource Brush.Border0}">
|
2024-04-19 02:35:42 -07:00
|
|
|
<Grid ColumnDefinitions="Auto,Auto,*">
|
2024-02-05 23:08:37 -08:00
|
|
|
<Path Grid.Column="0" Margin="8,0,0,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.File}"/>
|
|
|
|
<TextBlock Grid.Column="1" Text="{DynamicResource Text.Stashes.Changes}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold" Margin="8,0,0,0"/>
|
2024-04-19 02:35:42 -07:00
|
|
|
<TextBlock Grid.Column="2" Text="{Binding Changes, Converter={x:Static c:ListConverters.ToCount}}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
<!-- View Changes -->
|
2024-06-28 03:57:56 -07:00
|
|
|
<DataGrid Grid.Row="4"
|
2024-02-05 23:08:37 -08:00
|
|
|
Background="{DynamicResource Brush.Contents}"
|
|
|
|
ItemsSource="{Binding Changes}"
|
|
|
|
SelectedItem="{Binding SelectedChange, Mode=TwoWay}"
|
|
|
|
SelectionMode="Single"
|
|
|
|
CanUserReorderColumns="False"
|
|
|
|
CanUserResizeColumns="False"
|
|
|
|
CanUserSortColumns="False"
|
|
|
|
IsReadOnly="True"
|
|
|
|
HeadersVisibility="None"
|
|
|
|
Focusable="False"
|
|
|
|
RowHeight="26"
|
|
|
|
HorizontalScrollBarVisibility="Auto"
|
|
|
|
VerticalScrollBarVisibility="Auto">
|
|
|
|
<DataGrid.Columns>
|
|
|
|
<DataGridTemplateColumn Header="ICON">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate>
|
2024-07-17 01:56:16 -07:00
|
|
|
<v:ChangeStatusIcon Width="14" Height="14" 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>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<GridSplitter Grid.Column="1"
|
2024-03-26 00:18:34 -07:00
|
|
|
MinWidth=".5"
|
|
|
|
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">
|
2024-02-05 23:08:37 -08:00
|
|
|
<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 DiffContext}">
|
|
|
|
<ContentControl.DataTemplates>
|
|
|
|
<DataTemplate DataType="vm:DiffContext">
|
|
|
|
<v:DiffView/>
|
|
|
|
</DataTemplate>
|
|
|
|
</ContentControl.DataTemplates>
|
|
|
|
</ContentControl>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</UserControl>
|