sourcegit/src/Views/Histories.xaml

140 lines
7.1 KiB
Text
Raw Normal View History

<controls:Window
x:Class="SourceGit.Views.Histories"
x:Name="me"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:controls="clr-namespace:SourceGit.Views.Controls"
xmlns:models="clr-namespace:SourceGit.Models"
xmlns:widgets="clr-namespace:SourceGit.Views.Widgets"
mc:Ignorable="d"
Title="{DynamicResource Text.FileHistory}"
WindowStartupLocation="CenterOwner"
MinHeight="600" MinWidth="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="28"/>
<RowDefinition Height="1"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Title Bar -->
<Grid Grid.Row="0" Background="{DynamicResource Brush.TitleBar}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- Icon -->
<Path Grid.Column="0" Margin="6,0" Width="16" Height="16" Data="{StaticResource Icon.Histories}"/>
<!-- Title -->
<TextBlock Grid.Column="1" Text="{DynamicResource Text.FileHistory}"/>
<!-- Window Commands -->
<StackPanel Grid.Column="3" Orientation="Horizontal" WindowChrome.IsHitTestVisibleInChrome="True">
<controls:IconButton Click="Minimize" Width="28" Padding="8" Icon="{StaticResource Icon.Minimize}" HoverBackground="#40000000" Opacity="1"/>
<ToggleButton Style="{StaticResource Style.ToggleButton.MaxOrRestore}" Width="28" IsChecked="{Binding ElementName=me, Path=IsMaximized}"/>
<controls:IconButton Click="Quit" Width="28" Padding="8" Icon="{StaticResource Icon.Close}" HoverBackground="Red" Opacity="1"/>
</StackPanel>
</Grid>
<Rectangle
Grid.Row="1"
Height="1"
HorizontalAlignment="Stretch"
Fill="{DynamicResource Brush.Border0}"/>
<!-- Body -->
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" MinWidth="300" MaxWidth="600"/>
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Commit List -->
<DataGrid
x:Name="commitList"
Grid.Column="0"
Background="{DynamicResource Brush.Contents}"
BorderBrush="{DynamicResource Brush.Border0}"
BorderThickness="0,0,1,0"
SelectionMode="Single"
SelectionUnit="FullRow"
SelectedCellsChanged="OnCommitSelectedChanged">
<DataGrid.Columns>
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type models:Commit}">
<Border BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="0,0,0,1" Padding="4">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="36"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<controls:Avatar
Grid.Column="0"
HorizontalAlignment="Center"
Width="32" Height="32"
Email="{Binding Author.Email}"
FallbackLabel="{Binding Author.Name}"
ToolTip="{Binding Author.Name}"/>
<Grid Grid.Column="1" Margin="8,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="72"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" FontSize="9pt" FontFamily="Consolas">
2021-04-29 05:05:55 -07:00
<Hyperlink NavigateUri="{Binding SHA}" RequestNavigate="GotoCommit" Foreground="DarkOrange" ToolTip="GOTO COMMIT">
<Run Text="{Binding ShortSHA, Mode=OneWay}"/>
</Hyperlink>
</TextBlock>
2021-04-29 05:05:55 -07:00
2021-05-17 18:08:55 -07:00
<TextBlock
Grid.Column="1"
Text="{Binding Author.Time}"
FontSize="9pt" FontFamily="Consolas"
Foreground="{DynamicResource Brush.FG2}"
Margin="4,0,0,0"
HorizontalAlignment="Right"/>
2021-04-29 05:05:55 -07:00
</Grid>
<TextBlock
Grid.Row="1"
Text="{Binding Subject}"
FontSize="9pt" FontFamily="Consolas,Microsoft YaHei UI"
Margin="0,6,0,0"/>
2021-04-29 05:05:55 -07:00
</Grid>
</Grid>
</Border>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<!-- Loading -->
<controls:Loading Grid.Column="0" x:Name="loading" Width="48" Height="48" IsAnimating="True"/>
<!-- Splitter -->
<GridSplitter Grid.Column="1" Width="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Background="Transparent"/>
<!-- Diff Viewer -->
<widgets:DiffViewer Grid.Column="2" x:Name="diffViewer" Padding="4"/>
2021-04-29 05:05:55 -07:00
</Grid>
</Grid>
</controls:Window>