|
| 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:vm="using:SourceGit.ViewModels" |
| 7 | + xmlns:v="using:SourceGit.Views" |
| 8 | + xmlns:c="using:SourceGit.Converters" |
| 9 | + mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" |
| 10 | + x:Class="SourceGit.Views.ConventionalCommitMessageBuilder" |
| 11 | + x:DataType="vm:ConventionalCommitMessageBuilder" |
| 12 | + x:Name="ThisControl" |
| 13 | + Icon="/App.ico" |
| 14 | + Title="{DynamicResource Text.ConventionalCommit}" |
| 15 | + Width="600" |
| 16 | + SizeToContent="Height" |
| 17 | + CanResize="False" |
| 18 | + WindowStartupLocation="CenterOwner"> |
| 19 | + <Grid RowDefinitions="Auto,Auto,Auto" MinWidth="494"> |
| 20 | + <!-- TitleBar --> |
| 21 | + <Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto" Height="30" IsVisible="{Binding !#ThisControl.UseSystemWindowFrame}"> |
| 22 | + <Border Grid.Column="0" Grid.ColumnSpan="3" |
| 23 | + Background="{DynamicResource Brush.TitleBar}" |
| 24 | + BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border0}" |
| 25 | + PointerPressed="BeginMoveWindow"/> |
| 26 | + |
| 27 | + <Path Grid.Column="0" |
| 28 | + Width="14" Height="14" |
| 29 | + Data="{StaticResource Icons.Code}" |
| 30 | + Margin="10,0,0,0" |
| 31 | + IsVisible="{OnPlatform True, macOS=False}"/> |
| 32 | + |
| 33 | + <v:CaptionButtonsMacOS Grid.Column="0" |
| 34 | + Margin="0,2,0,0" |
| 35 | + IsCloseButtonOnly="True" |
| 36 | + IsVisible="{OnPlatform False, macOS=True}"/> |
| 37 | + |
| 38 | + <TextBlock Grid.Column="0" Grid.ColumnSpan="3" |
| 39 | + Classes="bold" |
| 40 | + Text="{DynamicResource Text.ConventionalCommit}" |
| 41 | + HorizontalAlignment="Center" VerticalAlignment="Center" |
| 42 | + IsHitTestVisible="False"/> |
| 43 | + |
| 44 | + <v:CaptionButtons Grid.Column="2" |
| 45 | + IsCloseButtonOnly="True" |
| 46 | + IsVisible="{OnPlatform True, macOS=False}"/> |
| 47 | + </Grid> |
| 48 | + |
| 49 | + <!-- Body --> |
| 50 | + <Grid Grid.Row="1" Margin="16,8" RowDefinitions="32,32,32,100,100,32" ColumnDefinitions="Auto,*"> |
| 51 | + <TextBlock Grid.Row="0" Grid.Column="0" |
| 52 | + HorizontalAlignment="Right" VerticalAlignment="Top" |
| 53 | + Margin="0,6,8,0" |
| 54 | + Text="{DynamicResource Text.ConventionalCommit.Type}"/> |
| 55 | + <ComboBox Grid.Row="0" Grid.Column="1" |
| 56 | + Height="28" Padding="8,0" |
| 57 | + VerticalAlignment="Center" HorizontalAlignment="Stretch" |
| 58 | + ItemsSource="{Binding Source={x:Static m:ConventionalCommitType.Supported}}" |
| 59 | + SelectedItem="{Binding Type, Mode=TwoWay}"> |
| 60 | + <ComboBox.ItemTemplate> |
| 61 | + <DataTemplate x:DataType="{x:Type m:ConventionalCommitType}"> |
| 62 | + <StackPanel Orientation="Horizontal" Height="20" VerticalAlignment="Center"> |
| 63 | + <TextBlock Text="{Binding Type}"/> |
| 64 | + <TextBlock Margin="6,0,0,0" Text="{Binding Description}" Foreground="{DynamicResource Brush.FG2}"/> |
| 65 | + </StackPanel> |
| 66 | + </DataTemplate> |
| 67 | + </ComboBox.ItemTemplate> |
| 68 | + </ComboBox> |
| 69 | + |
| 70 | + <TextBlock Grid.Row="1" Grid.Column="0" |
| 71 | + HorizontalAlignment="Right" VerticalAlignment="Top" |
| 72 | + Margin="0,6,8,0" |
| 73 | + Text="{DynamicResource Text.ConventionalCommit.Scope}"/> |
| 74 | + <TextBox Grid.Row="1" Grid.Column="1" |
| 75 | + Height="26" |
| 76 | + VerticalAlignment="Center" |
| 77 | + CornerRadius="2" |
| 78 | + Watermark="{DynamicResource Text.Optional}" |
| 79 | + Text="{Binding Scope, Mode=TwoWay}"/> |
| 80 | + |
| 81 | + <TextBlock Grid.Row="2" Grid.Column="0" |
| 82 | + HorizontalAlignment="Right" VerticalAlignment="Top" |
| 83 | + Margin="0,6,8,0" |
| 84 | + Text="{DynamicResource Text.ConventionalCommit.ShortDescription}"/> |
| 85 | + <TextBox Grid.Row="2" Grid.Column="1" |
| 86 | + Height="26" |
| 87 | + VerticalAlignment="Center" |
| 88 | + CornerRadius="2" |
| 89 | + Text="{Binding Description, Mode=TwoWay}"/> |
| 90 | + |
| 91 | + <TextBlock Grid.Row="3" Grid.Column="0" |
| 92 | + HorizontalAlignment="Right" VerticalAlignment="Top" |
| 93 | + Margin="0,6,8,0" |
| 94 | + Text="{DynamicResource Text.ConventionalCommit.Detail}"/> |
| 95 | + <TextBox Grid.Row="3" Grid.Column="1" |
| 96 | + Height="96" |
| 97 | + AcceptsReturn="True" |
| 98 | + AcceptsTab="True" |
| 99 | + TextWrapping="Wrap" |
| 100 | + ScrollViewer.HorizontalScrollBarVisibility="Disabled" |
| 101 | + ScrollViewer.VerticalScrollBarVisibility="Auto" |
| 102 | + VerticalAlignment="Center" |
| 103 | + VerticalContentAlignment="Top" |
| 104 | + CornerRadius="2" |
| 105 | + Watermark="{DynamicResource Text.Optional}" |
| 106 | + Text="{Binding Detail, Mode=TwoWay}"/> |
| 107 | + |
| 108 | + <TextBlock Grid.Row="4" Grid.Column="0" |
| 109 | + HorizontalAlignment="Right" VerticalAlignment="Top" |
| 110 | + Margin="0,6,8,0" |
| 111 | + Text="{DynamicResource Text.ConventionalCommit.BreakingChanges}"/> |
| 112 | + <TextBox Grid.Row="4" Grid.Column="1" |
| 113 | + Height="96" |
| 114 | + AcceptsReturn="True" |
| 115 | + AcceptsTab="True" |
| 116 | + TextWrapping="Wrap" |
| 117 | + ScrollViewer.HorizontalScrollBarVisibility="Disabled" |
| 118 | + ScrollViewer.VerticalScrollBarVisibility="Auto" |
| 119 | + VerticalAlignment="Center" |
| 120 | + VerticalContentAlignment="Top" |
| 121 | + CornerRadius="2" |
| 122 | + Watermark="{DynamicResource Text.Optional}" |
| 123 | + Text="{Binding BreakingChanges, Mode=TwoWay}"/> |
| 124 | + |
| 125 | + <TextBlock Grid.Row="5" Grid.Column="0" |
| 126 | + HorizontalAlignment="Right" VerticalAlignment="Top" |
| 127 | + Margin="0,6,8,0" |
| 128 | + Text="{DynamicResource Text.ConventionalCommit.ClosedIssue}"/> |
| 129 | + <TextBox Grid.Row="5" Grid.Column="1" |
| 130 | + Height="26" |
| 131 | + VerticalAlignment="Center" |
| 132 | + CornerRadius="2" |
| 133 | + Watermark="{DynamicResource Text.Optional}" |
| 134 | + Text="{Binding ClosedIssue, Mode=TwoWay}"/> |
| 135 | + </Grid> |
| 136 | + |
| 137 | + <!-- Apply Button --> |
| 138 | + <Button Grid.Row="2" |
| 139 | + Classes="flat primary" |
| 140 | + Height="32" Width="80" |
| 141 | + Margin="0,8,0,16" |
| 142 | + HorizontalAlignment="Center" |
| 143 | + Content="{DynamicResource Text.Sure}" |
| 144 | + Click="OnApplyClicked"/> |
| 145 | + </Grid> |
| 146 | +</v:ChromelessWindow> |
0 commit comments