feature<CommitGraph>: add polyline display mode

This commit is contained in:
leo 2021-05-19 16:14:46 +08:00
parent e1ca1224dc
commit e6182f9818
9 changed files with 112 additions and 16 deletions

View file

@ -23,6 +23,9 @@
<Geometry x:Key="Icon.Tree">M1024 610v-224H640v48H256V224h128V0H0v224h128v752h512v48h384V800H640v48H256V562h384v48z</Geometry>
<Geometry x:Key="Icon.Grid">M30 271l241 0 0-241-241 0 0 241zM392 271l241 0 0-241-241 0 0 241zM753 30l0 241 241 0 0-241-241 0zM30 632l241 0 0-241-241 0 0 241zM392 632l241 0 0-241-241 0 0 241zM753 632l241 0 0-241-241 0 0 241zM30 994l241 0 0-241-241 0 0 241zM392 994l241 0 0-241-241 0 0 241zM753 994l241 0 0-241-241 0 0 241z</Geometry>
<Geometry x:Key="Icon.Curve">M1017 598c0-25-25-50-50-50c-30 0-50 25-50 50c0 35-10 136-55 186c-25 25-55 35-95 35c-70 0-121-191-161-326c-50-196-100-377-231-377c-186 0-271 286-326 472c-10 40-20 75-30 95c-10 25 5 55 30 65c25 10 55-5 65-30c10-25 20-60 35-105c35-136 116-397 226-397c55 0 105 181 141 301c55 196 110 402 256 402c65 0 121-20 161-65c90-95 85-251 85-256z</Geometry>
<Geometry x:Key="Icon.Polyline">M341 475 147 675 65 593l271-284 281 265 254-295 89 77-336 387z</Geometry>
<Geometry x:Key="Icon.Down">M509 546l271-271 91 91-348 349-1-1-13 13-363-361 91-91z</Geometry>
<Geometry x:Key="Icon.DoubleDown">M256 224l0 115L512 544l256-205 0-115-256 205L256 224zM512 685l-256-205L256 595 512 800 768 595l0-115L512 685z</Geometry>
<Geometry x:Key="Icon.Up">M170 831l343-342L855 831l105-105-448-448L64 726 170 831z</Geometry>

View file

@ -254,7 +254,8 @@
<sys:String x:Key="Text.Histories">Histories</sys:String>
<sys:String x:Key="Text.Histories.Search">SEARCH SHA/SUBJECT/AUTHOR. PRESS ENTER TO SEARCH, ESC TO QUIT</sys:String>
<sys:String x:Key="Text.Histories.SearchClear">CLEAR</sys:String>
<sys:String x:Key="Text.Histories.DisplayMode">Toggle Horizontal/Vertical Layout</sys:String>
<sys:String x:Key="Text.Histories.GraphMode">Switch Curve/Polyline Graph Mode</sys:String>
<sys:String x:Key="Text.Histories.DisplayMode">Switch Horizontal/Vertical Layout</sys:String>
<sys:String x:Key="Text.Histories.Selected">SELECTED {0} COMMITS</sys:String>
<sys:String x:Key="Text.Histories.Guide">HISTORIES GUIDE</sys:String>
<sys:String x:Key="Text.Histories.Guide_1">1. Select single commit to view detail</sys:String>

View file

@ -254,6 +254,7 @@
<sys:String x:Key="Text.Histories">历史记录</sys:String>
<sys:String x:Key="Text.Histories.Search">查询提交指纹、信息、作者。回车键开始ESC键取消</sys:String>
<sys:String x:Key="Text.Histories.SearchClear">清空</sys:String>
<sys:String x:Key="Text.Histories.GraphMode">切换曲线/折线显示</sys:String>
<sys:String x:Key="Text.Histories.DisplayMode">切换横向/纵向显示</sys:String>
<sys:String x:Key="Text.Histories.Selected">已选中{0}项提交</sys:String>
<sys:String x:Key="Text.Histories.Guide">操作说明</sys:String>

View file

@ -90,8 +90,8 @@
<Path
x:Name="Icon"
Style="{DynamicResource Style.Icon}"
Height="{TemplateBinding Width}"
Width="{TemplateBinding Height}"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Fill="{TemplateBinding Foreground}"
Data="{DynamicResource Icon.Orientation}"
RenderTransformOrigin=".5,.5">
@ -114,4 +114,32 @@
</Setter.Value>
</Setter>
</Style>
<Style x:Key="Style.ToggleButton.CommitGraphMode" TargetType="{x:Type ToggleButton}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid Background="Transparent">
<Path
x:Name="Icon"
Style="{DynamicResource Style.Icon}"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Fill="{TemplateBinding Foreground}"
Data="{DynamicResource Icon.Curve}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Icon" Property="Data" Value="{DynamicResource Icon.Polyline}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>