|
| 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:c="using:SourceGit.Converters" |
| 6 | + xmlns:vm="using:SourceGit.ViewModels" |
| 7 | + xmlns:v="using:SourceGit.Views" |
| 8 | + mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" |
| 9 | + x:Class="SourceGit.Views.CommitMessageToolBox" |
| 10 | + x:Name="ThisControl"> |
| 11 | + <Border Background="{DynamicResource Brush.Contents}" |
| 12 | + BorderThickness="1" |
| 13 | + BorderBrush="{DynamicResource Brush.Border2}" |
| 14 | + CornerRadius="4"> |
| 15 | + <Grid RowDefinitions="*,1,24"> |
| 16 | + <v:CommitMessageTextEditor Grid.Row="0" |
| 17 | + x:Name="Editor" |
| 18 | + CommitMessage="{Binding #ThisControl.CommitMessage, Mode=TwoWay}" |
| 19 | + SubjectLineBrush="{DynamicResource Brush.Border2}" |
| 20 | + Foreground="{DynamicResource Brush.FG1}" |
| 21 | + FontFamily="{DynamicResource Fonts.Default}" |
| 22 | + FontSize="{Binding Source={x:Static vm:Preferences.Instance}, Path=EditorFontSize}" |
| 23 | + Tag="{Binding Source={x:Static v:StealHotKey.Enter}}"/> |
| 24 | + |
| 25 | + <Rectangle Grid.Row="1" |
| 26 | + Height="1" |
| 27 | + HorizontalAlignment="Stretch" |
| 28 | + VerticalAlignment="Center" |
| 29 | + IsHitTestVisible="False" |
| 30 | + Fill="{DynamicResource Brush.Border2}"/> |
| 31 | + |
| 32 | + <Border Grid.Row="2" |
| 33 | + Background="{DynamicResource Brush.Window}" |
| 34 | + BorderThickness="0" |
| 35 | + CornerRadius="0,0,4,4"> |
| 36 | + <Grid ColumnDefinitions="Auto,Auto,Auto,*" Margin="0,4"> |
| 37 | + <Button Grid.Column="0" |
| 38 | + Classes="icon_button" |
| 39 | + Width="24" |
| 40 | + Margin="0,0,4,0" Padding="0" |
| 41 | + Click="OnOpenCommitMessagePicker" |
| 42 | + IsVisible="{Binding #ThisControl.ShowAdvancedOptions}" |
| 43 | + ToolTip.Tip="{DynamicResource Text.WorkingCopy.CommitMessageHelper}"> |
| 44 | + <Path Width="12" Height="12" Data="{StaticResource Icons.Menu}"/> |
| 45 | + </Button> |
| 46 | + |
| 47 | + <Button Grid.Column="1" |
| 48 | + Classes="icon_button" |
| 49 | + Width="24" |
| 50 | + Margin="0,0,4,0" Padding="0" |
| 51 | + Click="OnOpenOpenAIHelper" |
| 52 | + IsVisible="{Binding #ThisControl.ShowAdvancedOptions}" |
| 53 | + ToolTip.Tip="{DynamicResource Text.AIAssistant.Tip}"> |
| 54 | + <Path Width="13" Height="13" Data="{StaticResource Icons.AIAssist}"/> |
| 55 | + </Button> |
| 56 | + |
| 57 | + <Button Grid.Column="2" |
| 58 | + Classes="icon_button" |
| 59 | + Width="24" |
| 60 | + Margin="0,0,4,0" Padding="0" |
| 61 | + Click="OnOpenConventionalCommitHelper" |
| 62 | + ToolTip.Tip="{DynamicResource Text.ConventionalCommit}"> |
| 63 | + <Path Width="13" Height="13" Margin="0,1,0,0" Data="{StaticResource Icons.CommitMessageGenerator}"/> |
| 64 | + </Button> |
| 65 | + |
| 66 | + <StackPanel Grid.Column="3" |
| 67 | + Margin="0,0,6,0" |
| 68 | + HorizontalAlignment="Right" |
| 69 | + VerticalAlignment="Center" |
| 70 | + Orientation="Horizontal"> |
| 71 | + <TextBlock Classes="info_label" FontSize="13" HorizontalAlignment="Left" Text="{DynamicResource Text.CommitMessageTextBox.SubjectCount}"/> |
| 72 | + <TextBlock Margin="8,0,0,0" FontSize="11" Text="{Binding #Editor.SubjectLength}" IsVisible="{Binding #Editor.SubjectLength, Converter={x:Static c:IntConverters.IsSubjectLengthGood}}" VerticalAlignment="Center"/> |
| 73 | + <TextBlock Margin="8,0,0,0" FontSize="11" Foreground="DarkGoldenrod" Text="{Binding #Editor.SubjectLength}" IsVisible="{Binding #Editor.SubjectLength, Converter={x:Static c:IntConverters.IsSubjectLengthBad}}" VerticalAlignment="Center"/> |
| 74 | + <TextBlock FontSize="11" Text="/" VerticalAlignment="Center"/> |
| 75 | + <TextBlock FontSize="11" Text="{Binding Source={x:Static vm:Preferences.Instance}, Path=SubjectGuideLength}" VerticalAlignment="Center"/> |
| 76 | + <Path Width="10" Height="10" Margin="4,0,0,0" Data="{StaticResource Icons.Error}" Fill="DarkGoldenrod" IsVisible="{Binding #Editor.SubjectLength, Converter={x:Static c:IntConverters.IsSubjectLengthBad}}"/> |
| 77 | + </StackPanel> |
| 78 | + </Grid> |
| 79 | + </Border> |
| 80 | + </Grid> |
| 81 | + </Border> |
| 82 | +</UserControl> |
0 commit comments