style<Histories>: change icons for buttons in histories panel

This commit is contained in:
leo 2021-04-02 16:26:16 +08:00
parent 1d401d0955
commit 5bc7f9021b
4 changed files with 23 additions and 21 deletions

View file

@ -45,9 +45,9 @@
<Geometry x:Key="Icon.Diff">M854.2 306.6L611.3 72.9c-6-5.7-13.9-8.9-22.2-8.9H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h277l219 210.6V824c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V329.6c0-8.7-3.5-17-9.8-23zM553.4 201.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v704c0 17.7 14.3 32 32 32h512c17.7 0 32-14.3 32-32V397.3c0-8.5-3.4-16.6-9.4-22.6L553.4 201.4zM568 753c0 3.8-3.4 7-7.5 7h-225c-4.1 0-7.5-3.2-7.5-7v-42c0-3.8 3.4-7 7.5-7h225c4.1 0 7.5 3.2 7.5 7v42z m0-220c0 3.8-3.4 7-7.5 7H476v84.9c0 3.9-3.1 7.1-7 7.1h-42c-3.8 0-7-3.2-7-7.1V540h-84.5c-4.1 0-7.5-3.2-7.5-7v-42c0-3.9 3.4-7 7.5-7H420v-84.9c0-3.9 3.2-7.1 7-7.1h42c3.9 0 7 3.2 7 7.1V484h84.5c4.1 0 7.5 3.1 7.5 7v42z</Geometry>
<Geometry x:Key="Icon.Filter">M599.22969 424.769286 599.22969 657.383158 424.769286 831.844585 424.769286 424.769286 192.155415 192.155415 831.844585 192.155415Z</Geometry>
<Geometry x:Key="Icon.Binary">M71.111111 1024V0h661.333333L952.888889 219.420444V1024H71.111111z m808.305778-731.420444l-220.444445-219.448889H144.583111V950.897778h734.833778V292.579556zM438.528 512h-220.444444V219.420444h220.444444V512z m-73.500444-219.420444H291.555556v146.289777h73.472v-146.289777z m0 512h73.500444v73.130666h-220.444444v-73.130666H291.555556v-146.289778H218.083556V585.102222h146.944v219.448889z m293.944888-365.710223h73.472V512H512v-73.130667h73.472v-146.289777H512V219.420444h146.972444v219.448889z m73.472 438.840889H512V585.130667h220.444444v292.579555z m-73.472-219.420444h-73.500444v146.289778h73.500444v-146.289778z</Geometry>
<Geometry x:Key="Icon.Vertical">M1024 1024H0V0h1024v1024z m-64-64V320H320V256h640V64H64v896h192V64h64v896z</Geometry>
<Geometry x:Key="Icon.Horizontal">M81.92 81.92v860.16h860.16V81.92H81.92z m802.304 57.856V322.56H139.776V139.776h744.448z m-744.448 240.64H322.56v503.808H139.776V380.416z m240.128 503.808V380.416h504.32v503.808H379.904z</Geometry>
<Geometry x:Key="Icon.Vertical">M64 146.304c0-45.482667 36.821333-82.304 82.304-82.304H877.653333c45.482667 0 82.304 36.821333 82.304 82.304V877.653333a82.304 82.304 0 0 1-82.304 82.304H146.346667A82.304 82.304 0 0 1 64 877.696V146.346667zM146.304 106.666667a39.637333 39.637333 0 0 0-39.637333 39.637333V877.653333c0 21.888 17.749333 39.637333 39.637333 39.637334H490.666667v-810.666667H146.304z m387.029333 0v810.666666h344.362667a39.637333 39.637333 0 0 0 39.637333-39.637333V146.346667a39.637333 39.637333 0 0 0-39.637333-39.637334H533.333333z</Geometry>
<Geometry x:Key="Icon.Horizontal">M64 146.304c0-45.482667 36.821333-82.304 82.304-82.304h731.434667c45.44 0 82.261333 36.821333 82.261333 82.304v731.434667a82.304 82.304 0 0 1-82.261333 82.261333H146.304A82.304 82.304 0 0 1 64 877.738667V146.304zM146.304 106.666667a39.637333 39.637333 0 0 0-39.637333 39.637333V490.666667h810.666666V146.304a39.637333 39.637333 0 0 0-39.594666-39.637333H146.304z m771.029333 426.666666h-810.666666v344.405334c0 21.888 17.749333 39.594667 39.637333 39.594666h731.434667a39.637333 39.637333 0 0 0 39.594666-39.594666V533.333333z</Geometry>
<Geometry x:Key="Icon.Fetch">M1024 896v128H0V704h128v192h768V704h128v192zM576 554.688L810.688 320 896 405.312l-384 384-384-384L213.312 320 448 554.688V0h128v554.688z</Geometry>
<Geometry x:Key="Icon.Pull">M432 0h160c26.6 0 48 21.4 48 48v336h175.4c35.6 0 53.4 43 28.2 68.2L539.4 756.6c-15 15-39.6 15-54.6 0L180.2 452.2c-25.2-25.2-7.4-68.2 28.2-68.2H384V48c0-26.6 21.4-48 48-48z m592 752v224c0 26.6-21.4 48-48 48H48c-26.6 0-48-21.4-48-48V752c0-26.6 21.4-48 48-48h293.4l98 98c40.2 40.2 105 40.2 145.2 0l98-98H976c26.6 0 48 21.4 48 48z m-248 176c0-22-18-40-40-40s-40 18-40 40 18 40 40 40 40-18 40-40z m128 0c0-22-18-40-40-40s-40 18-40 40 18 40 40 40 40-18 40-40z</Geometry>

View file

@ -89,19 +89,14 @@
<Grid Background="Transparent">
<Path
x:Name="Icon"
Width="18"
Height="18"
Style="{DynamicResource Style.Icon}"
Fill="{DynamicResource Brush.Border1}"
Data="{DynamicResource Icon.Horizontal}"/>
Fill="{DynamicResource Brush.FG2}"
Data="{DynamicResource Icon.Vertical}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Icon" Property="Data" Value="{DynamicResource Icon.Vertical}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Icon" Property="Fill" Value="{DynamicResource Brush.FG1}"/>
<Setter TargetName="Icon" Property="Data" Value="{DynamicResource Icon.Horizontal}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>

View file

@ -204,22 +204,22 @@
Checked="ChangeOrientation" Unchecked="ChangeOrientation"/>
<!-- Tips to Histories Panel -->
<Path
Width="20" Height="20"
Margin="8,0"
Data="{StaticResource Icon.Info}"
Fill="{StaticResource Brush.FG1}">
<Path.ToolTip>
<StackPanel Orientation="Vertical" TextElement.FontFamily="Consolas">
<Button Margin="4,0" ToolTip="{StaticResource Text.Histories.Guide}" Background="Transparent" Click="OpenGuide">
<Path Data="{StaticResource Icon.Info}" Fill="{StaticResource Brush.FG2}"/>
</Button>
<!-- Usage tooltip -->
<Popup x:Name="popupGuide" IsOpen="False" StaysOpen="False" Placement="Bottom">
<Border Background="{StaticResource Brush.Popup}" BorderThickness="1" BorderBrush="{StaticResource Brush.Border2}">
<StackPanel Orientation="Vertical" TextElement.FontFamily="Consolas" Margin="8">
<Label Content="{StaticResource Text.Histories.Guide}" FontWeight="Bold" FontSize="14" Margin="0,0,0,8"/>
<Label Content="{StaticResource Text.Histories.Guide_1}"/>
<Label Content="{StaticResource Text.Histories.Guide_2}"/>
<Label Content="{StaticResource Text.Histories.Guide_3}"/>
<Label Content="{StaticResource Text.Histories.Guide_4}"/>
</StackPanel>
</Path.ToolTip>
</Path>
</Border>
</Popup>
</StackPanel>
</Grid>
</Grid>

View file

@ -584,5 +584,12 @@ namespace SourceGit.UI {
layout.InvalidateVisual();
}
#endregion
#region GUIDE
private void OpenGuide(object sender, RoutedEventArgs e) {
popupGuide.IsOpen = !popupGuide.IsOpen;
e.Handled = true;
}
#endregion
}
}