fix<Stashes>: show time of stash

This commit is contained in:
leo 2024-01-02 15:32:19 +08:00
parent f04ab92efc
commit 22416812a0
2 changed files with 34 additions and 24 deletions

View file

@ -66,32 +66,42 @@
</Border>
<!-- Stashes List -->
<ListView
<DataGrid
Grid.Row="1"
x:Name="stashList"
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>
SelectionMode="Single"
SelectionUnit="FullRow"
SelectedCellsChanged="OnStashSelectionChanged">
<DataGrid.Columns>
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type models:Stash}">
<Border BorderBrush="{DynamicResource Brush.Border3}" BorderThickness="0,0,0,1" Background="Transparent" Padding="6" ContextMenuOpening="OnStashContextMenuOpening">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding SHA}" Foreground="DarkOrange"/>
<TextBlock Grid.Column="1" Text="{Binding TimeStr}" Foreground="{DynamicResource Brush.FG2}"/>
</Grid>
<TextBlock Grid.Row="1" Text="{Binding Message}" Margin="0,8,0,0"/>
</Grid>
</Border>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<!-- Change List Group -->
<Border Grid.Row="2" BorderBrush="{DynamicResource Brush.Border0}" BorderThickness="0,1">

View file

@ -47,7 +47,7 @@ namespace SourceGit.Views.Widgets {
e.Handled = true;
}
private async void OnStashSelectionChanged(object sender, SelectionChangedEventArgs e) {
private async void OnStashSelectionChanged(object sender, SelectedCellsChangedEventArgs e) {
changeList.ItemsSource = null;
selected = null;