|
| 1 | +<UserControl 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:vm="using:SourceGit.ViewModels" |
| 7 | + xmlns:c="using:SourceGit.Converters" |
| 8 | + mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" |
| 9 | + x:Class="SourceGit.Views.MergeMultiple" |
| 10 | + x:DataType="vm:MergeMultiple"> |
| 11 | + <StackPanel Orientation="Vertical" Margin="8,0"> |
| 12 | + <TextBlock FontSize="18" |
| 13 | + Classes="bold" |
| 14 | + Text="{DynamicResource Text.MergeMultiple}"/> |
| 15 | + <Grid Margin="0,16,0,0" RowDefinitions="Auto,32,32" ColumnDefinitions="100,*"> |
| 16 | + <TextBlock Grid.Row="0" Grid.Column="0" |
| 17 | + HorizontalAlignment="Right" VerticalAlignment="Center" |
| 18 | + Margin="0,0,8,0" |
| 19 | + Text="{DynamicResource Text.MergeMultiple.Commit}"/> |
| 20 | + <ListBox Grid.Row="0" Grid.Column="1" |
| 21 | + MinHeight="32" MaxHeight="100" |
| 22 | + ItemsSource="{Binding Targets}" |
| 23 | + Background="{DynamicResource Brush.Contents}" |
| 24 | + BorderThickness="1" |
| 25 | + BorderBrush="{DynamicResource Brush.Border2}" |
| 26 | + Padding="4" |
| 27 | + CornerRadius="4" |
| 28 | + ScrollViewer.HorizontalScrollBarVisibility="Disabled" |
| 29 | + ScrollViewer.VerticalScrollBarVisibility="Auto"> |
| 30 | + <ListBox.Styles> |
| 31 | + <Style Selector="ListBoxItem"> |
| 32 | + <Setter Property="Padding" Value="4,0"/> |
| 33 | + <Setter Property="Height" Value="26"/> |
| 34 | + <Setter Property="CornerRadius" Value="4"/> |
| 35 | + </Style> |
| 36 | + </ListBox.Styles> |
| 37 | + |
| 38 | + <ListBox.ItemsPanel> |
| 39 | + <ItemsPanelTemplate> |
| 40 | + <StackPanel Orientation="Vertical"/> |
| 41 | + </ItemsPanelTemplate> |
| 42 | + </ListBox.ItemsPanel> |
| 43 | + |
| 44 | + <ListBox.ItemTemplate> |
| 45 | + <DataTemplate DataType="m:Commit"> |
| 46 | + <Grid ColumnDefinitions="14,Auto,*"> |
| 47 | + <Path Grid.Column="0" Width="14" Height="14" Margin="0,8,0,0" Data="{StaticResource Icons.Commit}"/> |
| 48 | + <TextBlock Grid.Column="1" FontFamily="{DynamicResource Fonts.Monospace}" VerticalAlignment="Center" Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" Margin="6,0,4,0"/> |
| 49 | + <TextBlock Grid.Column="2" VerticalAlignment="Center" Text="{Binding Subject}" TextTrimming="CharacterEllipsis"/> |
| 50 | + </Grid> |
| 51 | + </DataTemplate> |
| 52 | + </ListBox.ItemTemplate> |
| 53 | + </ListBox> |
| 54 | + |
| 55 | + <CheckBox Grid.Row="1" Grid.Column="1" |
| 56 | + Content="{DynamicResource Text.MergeMultiple.CommitChanges}" |
| 57 | + IsChecked="{Binding AutoCommit, Mode=TwoWay}"/> |
| 58 | + |
| 59 | + <TextBlock Grid.Row="2" Grid.Column="0" |
| 60 | + HorizontalAlignment="Right" VerticalAlignment="Center" |
| 61 | + Margin="0,0,8,0" |
| 62 | + Text="{DynamicResource Text.MergeMultiple.Strategy}"/> |
| 63 | + <ComboBox Grid.Row="2" Grid.Column="1" |
| 64 | + Height="28" Padding="8,0" |
| 65 | + VerticalAlignment="Center" HorizontalAlignment="Stretch" |
| 66 | + ItemsSource="{Binding Source={x:Static m:MergeStrategy.ForMultiple}}" |
| 67 | + SelectedItem="{Binding Strategy, Mode=TwoWay}"> |
| 68 | + <ComboBox.ItemTemplate> |
| 69 | + <DataTemplate DataType="m:MergeStrategy"> |
| 70 | + <StackPanel Orientation="Horizontal" Height="20" VerticalAlignment="Center"> |
| 71 | + <TextBlock Text="{Binding Name}"/> |
| 72 | + <TextBlock Text="{Binding Desc}" Margin="8,0,0,0" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/> |
| 73 | + </StackPanel> |
| 74 | + </DataTemplate> |
| 75 | + </ComboBox.ItemTemplate> |
| 76 | + </ComboBox> |
| 77 | + </Grid> |
| 78 | + </StackPanel> |
| 79 | +</UserControl> |
0 commit comments