mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
ux: new style for statistics page
This commit is contained in:
parent
3d5a9f9d8b
commit
bcb83af576
6 changed files with 52 additions and 48 deletions
4
src/Resources/Locales.Designer.cs
generated
4
src/Resources/Locales.Designer.cs
generated
|
@ -3607,7 +3607,7 @@ namespace SourceGit.Resources {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Total Commits.
|
||||
/// Looks up a localized string similar to COMMITS: .
|
||||
/// </summary>
|
||||
public static string Text_Statistics_TotalCommits {
|
||||
get {
|
||||
|
@ -3616,7 +3616,7 @@ namespace SourceGit.Resources {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Total Committers.
|
||||
/// Looks up a localized string similar to COMMITTERS: .
|
||||
/// </summary>
|
||||
public static string Text_Statistics_TotalCommitters {
|
||||
get {
|
||||
|
|
|
@ -1201,10 +1201,10 @@
|
|||
<value>YEAR</value>
|
||||
</data>
|
||||
<data xml:space="preserve" name="Text.Statistics.TotalCommitters">
|
||||
<value>Total Committers</value>
|
||||
<value>COMMITTERS: </value>
|
||||
</data>
|
||||
<data xml:space="preserve" name="Text.Statistics.TotalCommits">
|
||||
<value>Total Commits</value>
|
||||
<value>COMMITS: </value>
|
||||
</data>
|
||||
<data xml:space="preserve" name="Text.Statistics.Committer">
|
||||
<value>COMMITTER</value>
|
||||
|
|
|
@ -1201,10 +1201,10 @@
|
|||
<value>YEAR</value>
|
||||
</data>
|
||||
<data xml:space="preserve" name="Text.Statistics.TotalCommitters">
|
||||
<value>Total Committers</value>
|
||||
<value>COMMITTERS: </value>
|
||||
</data>
|
||||
<data xml:space="preserve" name="Text.Statistics.TotalCommits">
|
||||
<value>Total Commits</value>
|
||||
<value>COMMITS: </value>
|
||||
</data>
|
||||
<data xml:space="preserve" name="Text.Statistics.Committer">
|
||||
<value>COMMITTER</value>
|
||||
|
|
|
@ -1198,10 +1198,10 @@
|
|||
<value>本年</value>
|
||||
</data>
|
||||
<data xml:space="preserve" name="Text.Statistics.TotalCommitters">
|
||||
<value>提交者人数</value>
|
||||
<value>提交者: </value>
|
||||
</data>
|
||||
<data xml:space="preserve" name="Text.Statistics.TotalCommits">
|
||||
<value>总计提交次数</value>
|
||||
<value>提交次数: </value>
|
||||
</data>
|
||||
<data xml:space="preserve" name="Text.Statistics.Committer">
|
||||
<value>提交者</value>
|
||||
|
|
|
@ -128,47 +128,52 @@
|
|||
<ContentControl Grid.Row="2" Content="{Binding SelectedReport, Mode=OneWay}">
|
||||
<ContentControl.DataTemplates>
|
||||
<DataTemplate DataType="m:StatisticsReport">
|
||||
<Grid RowDefinitions="*,32" ColumnDefinitions="256,*" Margin="8">
|
||||
<!-- Table By Committer -->
|
||||
<DataGrid Grid.Row="0" Grid.Column="0"
|
||||
ItemsSource="{Binding ByCommitter}"
|
||||
SelectionMode="Single"
|
||||
CanUserReorderColumns="False"
|
||||
CanUserResizeColumns="False"
|
||||
CanUserSortColumns="False"
|
||||
HeadersVisibility="Column"
|
||||
GridLinesVisibility="All"
|
||||
BorderThickness="1"
|
||||
BorderBrush="{DynamicResource Brush.Border1}"
|
||||
Background="{DynamicResource Brush.Contents}"
|
||||
IsReadOnly="True"
|
||||
RowHeight="26"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Width="150" Header="{DynamicResource Text.Statistics.Committer}" Binding="{Binding Name}"/>
|
||||
<DataGridTextColumn Width="*" Header="{DynamicResource Text.Statistics.CommitAmount}" Binding="{Binding Count}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Grid ColumnDefinitions="256,*" Margin="8,8,8,16">
|
||||
<Grid Grid.Column="0" RowDefinitions="*,16">
|
||||
<!-- Table By Committer -->
|
||||
<DataGrid Grid.Row="0"
|
||||
ItemsSource="{Binding ByCommitter}"
|
||||
SelectionMode="Single"
|
||||
CanUserReorderColumns="False"
|
||||
CanUserResizeColumns="False"
|
||||
CanUserSortColumns="False"
|
||||
HeadersVisibility="Column"
|
||||
GridLinesVisibility="All"
|
||||
BorderThickness="1"
|
||||
BorderBrush="{DynamicResource Brush.Border1}"
|
||||
Background="{DynamicResource Brush.Contents}"
|
||||
IsReadOnly="True"
|
||||
RowHeight="26"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Width="150" Header="{DynamicResource Text.Statistics.Committer}" Binding="{Binding Name}"/>
|
||||
<DataGridTextColumn Width="*" Header="{DynamicResource Text.Statistics.CommitAmount}" Binding="{Binding Count}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<!-- Total Committers -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
|
||||
<TextBlock Text="{DynamicResource Text.Statistics.TotalCommitters}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
|
||||
<TextBlock Text="{Binding ByCommitter.Count}" Margin="4,0,0,0"/>
|
||||
</StackPanel>
|
||||
<!-- Summary -->
|
||||
<Grid Grid.Row="1" ColumnDefinitions="*,*">
|
||||
<!-- Total Committers -->
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<TextBlock Classes="monospace" Text="{DynamicResource Text.Statistics.TotalCommitters}" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>
|
||||
<TextBlock Classes="monospace" Text="{Binding ByCommitter.Count}" FontSize="11" Margin="4,0,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Total Commits -->
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom">
|
||||
<TextBlock Classes="monospace" Text="{DynamicResource Text.Statistics.TotalCommits}" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>
|
||||
<TextBlock Classes="monospace" Text="{Binding Total}" FontSize="11" Margin="4,0,0,0"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<!-- Graph -->
|
||||
<v:Chart Grid.Row="0" Grid.Column="1"
|
||||
Margin="16,8,0,0"
|
||||
LineBrush="{DynamicResource Brush.FG1}"
|
||||
<v:Chart Grid.Column="1"
|
||||
Margin="16,0,0,0"
|
||||
LineBrush="{DynamicResource Brush.Border1}"
|
||||
ShapeBrush="{DynamicResource Brush.Accent1}"
|
||||
Samples="{Binding Samples}"/>
|
||||
|
||||
<!-- Total Commits -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<TextBlock Text="{DynamicResource Text.Statistics.TotalCommits}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
|
||||
<TextBlock Text="{Binding Total}" Margin="4,0,0,0"/>
|
||||
</StackPanel>
|
||||
Samples="{Binding Samples}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ContentControl.DataTemplates>
|
||||
|
|
|
@ -104,8 +104,7 @@ namespace SourceGit.Views
|
|||
var horizonStart = maxLabel.Width + 8;
|
||||
var labelHeight = maxLabel.Height;
|
||||
context.DrawText(maxLabel, new Point(0, -maxLabel.Height * 0.5));
|
||||
context.DrawLine(pen, new Point(horizonStart, 0), new Point(horizonStart, height - labelHeight));
|
||||
context.DrawLine(pen, new Point(horizonStart, height - labelHeight), new Point(width, height - labelHeight));
|
||||
context.DrawRectangle(pen, new Rect(horizonStart, 0, width - horizonStart, height - labelHeight));
|
||||
|
||||
if (samples.Count == 0)
|
||||
return;
|
||||
|
@ -114,7 +113,7 @@ namespace SourceGit.Views
|
|||
var stepX = (width - horizonStart) / samples.Count;
|
||||
var stepV = (height - labelHeight) / 5;
|
||||
var labelStepV = maxV / 5;
|
||||
var gridPen = new Pen(LineBrush, 1, new DashStyle());
|
||||
var gridPen = new Pen(LineBrush, 1, new DashStyle() { Dashes = [2, 2, 0, 2], Offset = 1 });
|
||||
for (int i = 1; i < 5; i++)
|
||||
{
|
||||
var vLabel = new FormattedText(
|
||||
|
|
Loading…
Reference in a new issue