mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
131 lines
6.2 KiB
XML
131 lines
6.2 KiB
XML
<UserControl x:Class="SourceGit.Views.Widgets.Stashes"
|
|
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:controls="clr-namespace:SourceGit.Views.Controls"
|
|
xmlns:widgets="clr-namespace:SourceGit.Views.Widgets"
|
|
xmlns:models="clr-namespace:SourceGit.Models"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="450" d:DesignWidth="800">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="300" MinWidth="300"/>
|
|
<ColumnDefinition Width="1"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- Left -->
|
|
<Grid Grid.Column="0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="26"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="26"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Stashes List Group -->
|
|
<Border Grid.Row="0" BorderBrush="{DynamicResource Brush.Border0}" BorderThickness="0,0,0,1">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Path
|
|
Margin="4,0"
|
|
Width="12" Height="12"
|
|
Fill="{DynamicResource Brush.FG2}"
|
|
Data="{StaticResource Icon.Stashes}"/>
|
|
|
|
<TextBlock
|
|
Margin="4,0,0,0"
|
|
Text="{DynamicResource Text.Stashes.Stashes}"
|
|
Foreground="{DynamicResource Brush.FG2}"
|
|
FontFamily="Microsoft YaHei UI"
|
|
FontWeight="Bold"/>
|
|
|
|
<controls:Loading
|
|
x:Name="waiting"
|
|
Width="12" Height="12"
|
|
Margin="8,0,0,0"
|
|
Visibility="Collapsed"/>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<!-- Stashes List -->
|
|
<ListView
|
|
Grid.Row="1"
|
|
x:Name="stashList"
|
|
Background="{DynamicResource Brush.Contents}"
|
|
BorderThickness="0"
|
|
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
|
SelectionChanged="OnStashSelectionChanged">
|
|
<ListView.ItemTemplate>
|
|
<DataTemplate DataType="{x:Type models:Stash}">
|
|
<Border BorderBrush="{DynamicResource Brush.Border3}" BorderThickness="0,0,0,1" Background="Transparent" Padding="6" ContextMenuOpening="OnStashContextMenuOpening">
|
|
<StackPanel Orientation="Vertical">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Grid.Column="0" Text="{Binding SHA}" Foreground="{DynamicResource Brush.FG2}"/>
|
|
<TextBlock Grid.Column="1" Text="{Binding Author.Time}" Foreground="{DynamicResource Brush.FG2}"/>
|
|
</Grid>
|
|
<TextBlock Text="{Binding Message}" Margin="0,8,0,0"/>
|
|
</StackPanel>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ListView.ItemTemplate>
|
|
</ListView>
|
|
|
|
<!-- Change List Group -->
|
|
<Border Grid.Row="2" BorderBrush="{DynamicResource Brush.Border0}" BorderThickness="0,1">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Path
|
|
Margin="4,0"
|
|
Width="12" Height="12"
|
|
Fill="{DynamicResource Brush.FG2}"
|
|
Data="{StaticResource Icon.File}"/>
|
|
|
|
<TextBlock
|
|
Margin="4,0,0,0"
|
|
Text="{DynamicResource Text.Stashes.Changes}"
|
|
Foreground="{DynamicResource Brush.FG2}"
|
|
FontFamily="Microsoft YaHei UI"
|
|
FontWeight="Bold"/>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<!-- Changed Files -->
|
|
<DataGrid
|
|
Grid.Row="3"
|
|
x:Name="changeList"
|
|
Background="{DynamicResource Brush.Contents}"
|
|
RowHeight="24"
|
|
SelectionMode="Single"
|
|
SelectionUnit="FullRow"
|
|
SelectionChanged="OnChangeSelectionChanged">
|
|
<DataGrid.Columns>
|
|
<DataGridTemplateColumn Width="22" IsReadOnly="True">
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<controls:ChangeStatusIcon Width="14" Height="14" IsLocalChange="False" Change="{Binding}"/>
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>
|
|
<DataGridTemplateColumn Width="*" IsReadOnly="True">
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Margin="2,0,0,0" Text="{Binding Path}"/>
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
</Grid>
|
|
|
|
<!-- Splitter -->
|
|
<GridSplitter Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Width="1" Background="{DynamicResource Brush.Border0}"/>
|
|
|
|
<!-- Right -->
|
|
<widgets:DiffViewer Grid.Column="2" x:Name="diffViewer" Margin="4"/>
|
|
</Grid>
|
|
</UserControl>
|