|
| 1 | +<v:ChromelessWindow xmlns="https://github.com/avaloniaui" |
| 2 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 4 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 5 | + xmlns:m="using:SourceGit.Models" |
| 6 | + xmlns:v="using:SourceGit.Views" |
| 7 | + xmlns:vm="using:SourceGit.ViewModels" |
| 8 | + xmlns:c="using:SourceGit.Converters" |
| 9 | + mc:Ignorable="d" d:DesignWidth="520" d:DesignHeight="230" |
| 10 | + x:Class="SourceGit.Views.GotoParentSelector" |
| 11 | + x:DataType="vm:GotoParentSelector" |
| 12 | + x:Name="ThisControl" |
| 13 | + Icon="/App.ico" |
| 14 | + Title="{DynamicResource Text.GotoParentSelector}" |
| 15 | + Width="600" SizeToContent="Height" |
| 16 | + CanResize="False" |
| 17 | + WindowStartupLocation="CenterOwner"> |
| 18 | + <Grid RowDefinitions="Auto,Auto"> |
| 19 | + <!-- TitleBar --> |
| 20 | + <Grid Grid.Row="0" Height="28" IsVisible="{Binding !#ThisControl.UseSystemWindowFrame}"> |
| 21 | + <Border Background="{DynamicResource Brush.TitleBar}" |
| 22 | + BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border0}" |
| 23 | + PointerPressed="BeginMoveWindow"/> |
| 24 | + |
| 25 | + <Path Width="14" Height="14" |
| 26 | + Margin="10,0,0,0" |
| 27 | + HorizontalAlignment="Left" |
| 28 | + Data="{StaticResource Icons.GotoParent}" |
| 29 | + IsVisible="{OnPlatform True, macOS=False}"/> |
| 30 | + |
| 31 | + <TextBlock Classes="bold" |
| 32 | + Text="{DynamicResource Text.GotoParentSelector}" |
| 33 | + HorizontalAlignment="Center" VerticalAlignment="Center" |
| 34 | + IsHitTestVisible="False"/> |
| 35 | + |
| 36 | + <v:CaptionButtons HorizontalAlignment="Right" |
| 37 | + IsCloseButtonOnly="True" |
| 38 | + IsVisible="{OnPlatform True, macOS=False}"/> |
| 39 | + </Grid> |
| 40 | + |
| 41 | + <ListBox Grid.Row="1" |
| 42 | + Focusable="True" |
| 43 | + Margin="8" Padding="4" |
| 44 | + ItemsSource="{Binding Parents}" |
| 45 | + SelectionMode="AlwaysSelected" |
| 46 | + BorderThickness="0" |
| 47 | + Background="Transparent" |
| 48 | + Grid.IsSharedSizeScope="True" |
| 49 | + ScrollViewer.HorizontalScrollBarVisibility="Disabled" |
| 50 | + ScrollViewer.VerticalScrollBarVisibility="Disabled" |
| 51 | + Loaded="OnListLoaded" |
| 52 | + KeyDown="OnListKeyDown"> |
| 53 | + <ListBox.Styles> |
| 54 | + <Style Selector="ListBoxItem"> |
| 55 | + <Setter Property="Margin" Value="0"/> |
| 56 | + <Setter Property="Padding" Value="0"/> |
| 57 | + <Setter Property="Height" Value="28"/> |
| 58 | + <Setter Property="CornerRadius" Value="4"/> |
| 59 | + </Style> |
| 60 | + </ListBox.Styles> |
| 61 | + |
| 62 | + <ListBox.ItemsPanel> |
| 63 | + <ItemsPanelTemplate> |
| 64 | + <StackPanel Orientation="Vertical" Spacing="2"/> |
| 65 | + </ItemsPanelTemplate> |
| 66 | + </ListBox.ItemsPanel> |
| 67 | + |
| 68 | + <ListBox.ItemTemplate> |
| 69 | + <DataTemplate DataType="m:Commit"> |
| 70 | + <Grid Background="Transparent" Tapped="OnListItemTapped"> |
| 71 | + <Grid.ColumnDefinitions> |
| 72 | + <ColumnDefinition Width="24"/> |
| 73 | + <ColumnDefinition Width="*"/> |
| 74 | + <ColumnDefinition Width="Auto" SharedSizeGroup="CommitSHAColumn"/> |
| 75 | + <ColumnDefinition Width="Auto" SharedSizeGroup="CommitTimeColumn"/> |
| 76 | + </Grid.ColumnDefinitions> |
| 77 | + |
| 78 | + <v:Avatar Grid.Column="0" |
| 79 | + Width="16" Height="16" |
| 80 | + HorizontalAlignment="Center" VerticalAlignment="Center" |
| 81 | + IsHitTestVisible="False" |
| 82 | + User="{Binding Author}"/> |
| 83 | + |
| 84 | + <Border Grid.Column="1" Margin="2,0,0,0" ClipToBounds="True"> |
| 85 | + <TextBlock Text="{Binding Subject}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"/> |
| 86 | + </Border> |
| 87 | + |
| 88 | + <TextBlock Grid.Column="2" |
| 89 | + Margin="4,0,0,0" |
| 90 | + Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" |
| 91 | + Foreground="DarkOrange" |
| 92 | + VerticalAlignment="Center"/> |
| 93 | + |
| 94 | + <TextBlock Grid.Column="3" |
| 95 | + Margin="4,0" |
| 96 | + Text="{Binding CommitterTimeShortStr}" |
| 97 | + HorizontalAlignment="Right" VerticalAlignment="Center"/> |
| 98 | + </Grid> |
| 99 | + </DataTemplate> |
| 100 | + </ListBox.ItemTemplate> |
| 101 | + </ListBox> |
| 102 | + </Grid> |
| 103 | +</v:ChromelessWindow> |
0 commit comments