|
13 | 13 | BorderBrush="{DynamicResource Brush.Border2}" |
14 | 14 | CornerRadius="4"> |
15 | 15 | <Grid RowDefinitions="*,1,24"> |
16 | | - <v:CommitMessageTextEditor Grid.Row="0" |
17 | | - x:Name="Editor" |
18 | | - CommitMessage="{Binding #ThisControl.CommitMessage, Mode=TwoWay}" |
19 | | - Placeholder="{DynamicResource Text.CommitMessageTextBox.Placeholder}" |
20 | | - SubjectLineBrush="{DynamicResource Brush.Border2}" |
21 | | - SubjectGuideLength="{Binding Source={x:Static vm:Preferences.Instance}, Path=SubjectGuideLength, Mode=OneWay}" |
22 | | - Foreground="{DynamicResource Brush.FG1}" |
23 | | - FontFamily="{DynamicResource Fonts.Default}" |
24 | | - FontSize="{Binding Source={x:Static vm:Preferences.Instance}, Path=EditorFontSize, Mode=OneWay}"/> |
| 16 | + <Grid Grid.Row="0"> |
| 17 | + <v:CommitMessageTextBox x:Name="Editor" |
| 18 | + Classes="no_border" |
| 19 | + CornerRadius="4,4,0,0" |
| 20 | + Background="Transparent" |
| 21 | + Text="{Binding #ThisControl.CommitMessage, Mode=TwoWay}" |
| 22 | + PlaceholderText="{DynamicResource Text.CommitMessageTextBox.Placeholder}" |
| 23 | + SubjectGuideLength="{Binding Source={x:Static vm:Preferences.Instance}, Path=SubjectGuideLength, Mode=OneWay}" |
| 24 | + FontSize="{Binding Source={x:Static vm:Preferences.Instance}, Path=EditorFontSize, Mode=OneWay}"/> |
| 25 | + |
| 26 | + <v:CommitMessageSubjectEndIndicator LineBrush="{DynamicResource Brush.Border2}" |
| 27 | + FontFamily="{DynamicResource Fonts.Default}" |
| 28 | + SubjectEndY="{Binding #Editor.SubjectEndY, Mode=OneWay}"/> |
| 29 | + |
| 30 | + <Popup PlacementTarget="#Editor" |
| 31 | + Placement="AnchorAndGravity" |
| 32 | + PlacementAnchor="TopLeft" |
| 33 | + PlacementGravity="BottomRight" |
| 34 | + HorizontalOffset="-4" VerticalOffset="{Binding #Editor.SuggestionPopupY, Mode=OneWay}"> |
| 35 | + <Popup.IsOpen> |
| 36 | + <MultiBinding Converter="{x:Static BoolConverters.And}"> |
| 37 | + <Binding Path="#Editor.Suggestions" Converter="{x:Static c:ListConverters.IsNotNullOrEmpty}"/> |
| 38 | + <Binding Path="$parent[Window].IsActive"/> |
| 39 | + </MultiBinding> |
| 40 | + </Popup.IsOpen> |
| 41 | + |
| 42 | + <Border Margin="8" VerticalAlignment="Top" Effect="drop-shadow(0 0 8 #80000000)"> |
| 43 | + <Border Background="{DynamicResource Brush.Popup}" CornerRadius="4" Padding="4" BorderThickness="0.65" BorderBrush="{DynamicResource Brush.Border0}"> |
| 44 | + <v:ListBoxEx x:Name="SuggestionBox" |
| 45 | + Background="Transparent" |
| 46 | + SelectionMode="Single" |
| 47 | + ItemsSource="{Binding #Editor.Suggestions, Mode=OneWay}" |
| 48 | + SelectedIndex="{Binding #Editor.SelectedSuggestionIndex, Mode=TwoWay}" |
| 49 | + MaxHeight="400" |
| 50 | + Focusable="False"> |
| 51 | + <ListBox.Styles> |
| 52 | + <Style Selector="ListBoxItem"> |
| 53 | + <Setter Property="Padding" Value="0"/> |
| 54 | + <Setter Property="MinWidth" Value="140"/> |
| 55 | + <Setter Property="MinHeight" Value="26"/> |
| 56 | + <Setter Property="CornerRadius" Value="4"/> |
| 57 | + <Setter Property="Focusable" Value="False"/> |
| 58 | + </Style> |
| 59 | + </ListBox.Styles> |
| 60 | + |
| 61 | + <ListBox.ItemsPanel> |
| 62 | + <ItemsPanelTemplate> |
| 63 | + <StackPanel Orientation="Vertical" Spacing="2"/> |
| 64 | + </ItemsPanelTemplate> |
| 65 | + </ListBox.ItemsPanel> |
| 66 | + |
| 67 | + <ListBox.ItemTemplate> |
| 68 | + <DataTemplate DataType="v:CommitMessageTextBoxSuggestion"> |
| 69 | + <Border Padding="8,0" Height="26" Background="Transparent" Tapped="OnSuggestionTapped"> |
| 70 | + <TextBlock Text="{Binding Text, Mode=OneWay}" VerticalAlignment="Center"/> |
| 71 | + </Border> |
| 72 | + </DataTemplate> |
| 73 | + </ListBox.ItemTemplate> |
| 74 | + </v:ListBoxEx> |
| 75 | + </Border> |
| 76 | + </Border> |
| 77 | + </Popup> |
| 78 | + </Grid> |
25 | 79 |
|
26 | 80 | <Rectangle Grid.Row="1" |
27 | 81 | Height="1" |
|
95 | 149 | <TextBlock Margin="8,0,0,0" |
96 | 150 | FontSize="11" |
97 | 151 | Text="{Binding #Editor.SubjectLength}" |
98 | | - Foreground="{Binding #Editor.IsSubjectWarningIconVisible, Converter={x:Static c:BoolConverters.IsWarningToBrush}, Mode=OneWay}" |
| 152 | + Foreground="{Binding #Editor.WarnSubjectLength, Converter={x:Static c:BoolConverters.IsWarningToBrush}, Mode=OneWay}" |
99 | 153 | VerticalAlignment="Center"/> |
100 | 154 | <TextBlock FontSize="11" |
101 | 155 | Text="/" |
102 | 156 | VerticalAlignment="Center"/> |
103 | 157 | <TextBlock FontSize="11" |
104 | 158 | Text="{Binding #Editor.SubjectGuideLength, Mode=OneWay}" |
105 | 159 | VerticalAlignment="Center"/> |
106 | | - <Path Width="10" Height="10" Margin="4,0,0,0" Data="{StaticResource Icons.Error}" Fill="DarkGoldenrod" IsVisible="{Binding #Editor.IsSubjectWarningIconVisible, Mode=OneWay}"/> |
| 160 | + <Path Width="10" Height="10" Margin="4,0,0,0" Data="{StaticResource Icons.Error}" Fill="DarkGoldenrod" IsVisible="{Binding #Editor.WarnSubjectLength, Mode=OneWay}"/> |
107 | 161 | </StackPanel> |
108 | 162 | </Grid> |
109 | 163 | </Border> |
|
0 commit comments