style<CommitViewer>: combine subject and message into one TextBox and enable TextWrap on it

This commit is contained in:
leo 2021-04-09 10:34:33 +08:00
parent 04ea6816f4
commit b5ebb4d76f
2 changed files with 7 additions and 22 deletions

View file

@ -105,7 +105,6 @@
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition x:Name="refRow" Height="Auto"/> <RowDefinition x:Name="refRow" Height="Auto"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition x:Name="descRow" Height="Auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@ -194,26 +193,20 @@
</ItemsControl> </ItemsControl>
<!-- MESSAGE --> <!-- MESSAGE -->
<Label Grid.Row="3" Grid.Column="0" Content="{StaticResource Text.CommitViewer.Info.Message}" HorizontalAlignment="Right" Opacity=".6"/> <Label Grid.Row="3" Grid.Column="0" Content="{StaticResource Text.CommitViewer.Info.Message}" HorizontalAlignment="Right" VerticalAlignment="Top" Opacity=".6"/>
<TextBox <TextBox
Grid.Row="3" Grid.Column="1" Grid.Row="3" Grid.Column="1"
x:Name="subject" x:Name="message"
IsReadOnly="True" IsReadOnly="True"
Background="Transparent" Background="Transparent"
FontFamily="Consolas" FontFamily="Consolas"
BorderThickness="0" BorderThickness="0"
Margin="11,0,16,0"/> TextWrapping="Wrap"
<TextBox Margin="11,5,16,0"
Grid.Row="4" Grid.Column="1" VerticalAlignment="Top"/>
x:Name="message"
IsReadOnly="True"
Background="Transparent"
BorderThickness="0"
FontSize="11"
Margin="11,8,0,0"/>
</Grid> </Grid>
<Rectangle Grid.Row="3" Grid.ColumnSpan="2" Height="1" Margin="8" Fill="{StaticResource Brush.Border2}"/> <Rectangle Grid.Row="3" Height="1" Margin="8" Fill="{StaticResource Brush.Border2}"/>
<!-- Changes --> <!-- Changes -->
<Grid Grid.Row="4"> <Grid Grid.Row="4">

View file

@ -85,15 +85,7 @@ namespace SourceGit.UI {
SHA.Text = commit.SHA; SHA.Text = commit.SHA;
refs.ItemsSource = commit.Decorators; refs.ItemsSource = commit.Decorators;
parents.ItemsSource = parentIds; parents.ItemsSource = parentIds;
subject.Text = commit.Subject; message.Text = (commit.Subject + "\n\n" + commit.Message.Trim()).Trim();
var commitMsg = commit.Message.Trim();
if (string.IsNullOrEmpty(commitMsg)) {
descRow.Height = new GridLength(0);
} else {
descRow.Height = GridLength.Auto;
message.Text = commitMsg;
}
authorName.Text = commit.Author.Name; authorName.Text = commit.Author.Name;
authorEmail.Text = commit.Author.Email; authorEmail.Text = commit.Author.Email;