style<Histories>: move guide into a tooltip button

This commit is contained in:
leo 2020-12-10 21:15:59 +08:00
parent 74a9ec42d7
commit a53d3f642d
3 changed files with 44 additions and 32 deletions

View file

@ -6,6 +6,8 @@
<Geometry x:Key="Icon.User">M 841.758 299.375 c 0 165.25 -134 299.375 -299.375 299.375 S 243.009 464.75 243.009 299.375 S 377.009 0 542.383 0 c 165.25 0 299.375 134 299.375 299.375 Z m 0 0 M 789.383 612.75 c -69.75 55.125 -156.25 85.625 -247.125 85.625 c -91.875 0 -179.25 -31.25 -249.25 -87.375 C 108.384 678.875 25.8838 915.75 25.8838 1024 h 1027.75 c 0 -107.25 -83.125 -342.5 -264.25 -411.25 Z m 0 0</Geometry> <Geometry x:Key="Icon.User">M 841.758 299.375 c 0 165.25 -134 299.375 -299.375 299.375 S 243.009 464.75 243.009 299.375 S 377.009 0 542.383 0 c 165.25 0 299.375 134 299.375 299.375 Z m 0 0 M 789.383 612.75 c -69.75 55.125 -156.25 85.625 -247.125 85.625 c -91.875 0 -179.25 -31.25 -249.25 -87.375 C 108.384 678.875 25.8838 915.75 25.8838 1024 h 1027.75 c 0 -107.25 -83.125 -342.5 -264.25 -411.25 Z m 0 0</Geometry>
<Geometry x:Key="Icon.Home">M1024 590.432 512 193.024 0 590.432 0 428.416 512 30.976 1024 428.416ZM896 576 896 960 640 960 640 704 384 704 384 960 128 960 128 576 512 288Z</Geometry> <Geometry x:Key="Icon.Home">M1024 590.432 512 193.024 0 590.432 0 428.416 512 30.976 1024 428.416ZM896 576 896 960 640 960 640 704 384 704 384 960 128 960 128 576 512 288Z</Geometry>
<Geometry x:Key="Icon.Bookmark">M192 0l0 1024 320-320 320 320 0-1024z</Geometry> <Geometry x:Key="Icon.Bookmark">M192 0l0 1024 320-320 320 320 0-1024z</Geometry>
<Geometry x:Key="Icon.Help">M512 96C282.2 96 96 282.2 96 512s186.2 416 416 416 416-186.2 416-416S741.8 96 512 96z m-8.6 608c-23.6 0-42.8-18-42.8-41.2 0-23 19.2-41.2 42.8-41.2 23.8 0 43 18 43 41.2 0 23.2-19 41.2-43 41.2z m80.4-193.8c-34.8 20.2-46.6 35-46.6 60.6v15.8h-69.4l-0.6-17.2c-3.4-41.2 11-66.8 47.2-88 33.8-20.2 48-33 48-57.8s-24-43-53.8-43c-30.2 0-52 19.6-53.6 49.2H384c1.4-64.4 49-110 129.4-110 75 0 126.6 41.6 126.6 101.4 0 39.8-19.2 67.2-56.2 89z</Geometry>
<Geometry x:Key="Icon.Detail">M888.832 0H135.168c-32.256 0-58.88 26.112-58.88 58.88v906.24c0 32.256 26.112 58.88 58.88 58.88h753.152c32.256 0 58.88-26.112 58.88-58.88v-906.24c0.512-32.768-26.112-58.88-58.368-58.88z m-164.864 176.64c30.72 0 55.808 25.088 55.808 55.808s-25.088 55.808-55.808 55.808-55.808-25.088-55.808-55.808 24.576-55.808 55.808-55.808z m-211.968 0c30.72 0 55.808 25.088 55.808 55.808S542.72 288.256 512 288.256s-55.808-25.088-55.808-55.808S481.28 176.64 512 176.64z m-211.968 0c30.72 0 55.808 25.088 55.808 55.808s-25.088 55.808-55.808 55.808-55.808-25.088-55.808-55.808 25.088-55.808 55.808-55.808z m208.896 606.208H285.184c-24.576 0-44.032-19.968-44.032-44.032 0-24.576 19.968-44.032 44.032-44.032h223.744c24.576 0 44.032 19.968 44.032 44.032 0 24.064-19.456 44.032-44.032 44.032z m229.888-211.968H285.184c-24.576 0-44.032-19.968-44.032-44.032 0-24.576 19.968-44.032 44.032-44.032h453.12c24.576 0 44.032 19.968 44.032 44.032 0.512 24.064-19.456 44.032-43.52 44.032z</Geometry>
<Geometry x:Key="Icon.ScrollLeft">M753.613 996.727L269.38 511.505 754.602 27.272z</Geometry> <Geometry x:Key="Icon.ScrollLeft">M753.613 996.727L269.38 511.505 754.602 27.272z</Geometry>
<Geometry x:Key="Icon.ScrollRight">M270.387 27.273L754.62 512.495 269.398 996.728z</Geometry> <Geometry x:Key="Icon.ScrollRight">M270.387 27.273L754.62 512.495 269.398 996.728z</Geometry>

View file

@ -170,36 +170,45 @@
<!-- Diff with selected 2 commit --> <!-- Diff with selected 2 commit -->
<local:TwoCommitsDiff x:Name="twoCommitDiff" Visibility="Collapsed"/> <local:TwoCommitsDiff x:Name="twoCommitDiff" Visibility="Collapsed"/>
<!-- Mask for select multi rows in commit list --> <!-- Mask -->
<Border x:Name="selectionCounter" Background="{StaticResource Brush.BG1}" Visibility="Collapsed"> <Border x:Name="mask" Background="{StaticResource Brush.BG1}">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" Opacity=".25"> <StackPanel Orientation="Vertical" VerticalAlignment="Center" Opacity=".25">
<Path Width="160" Height="160" Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Git}"/> <Path Width="128" Height="128" Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Detail}"/>
<Label x:Name="txtTotalSelected" Content="SELECT TO VIEW DETAIL" FontFamily="Consolas" Margin="0,16,0,0" FontSize="24" FontWeight="UltraBold" HorizontalAlignment="Center"/> <Label x:Name="txtCounter" Visibility="Hidden" FontFamily="Consolas" Margin="0,16,0,0" FontSize="24" FontWeight="UltraBold" HorizontalAlignment="Center"/>
</StackPanel> </StackPanel>
</Border> </Border>
<!-- Usage Page --> <!-- Right-Top Buttons -->
<Border x:Name="welcome" Background="{StaticResource Brush.BG1}"> <StackPanel
<StackPanel Orientation="Vertical" VerticalAlignment="Center" Opacity=".25">
<Path Width="120" Height="120" Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Git}"/>
<Label Content="HISTORIES GUIDE" FontFamily="Consolas" FontWeight="ExtraBold" FontSize="24" HorizontalAlignment="Center" Margin="0,32,0,16"/>
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" TextElement.FontFamily="Consolas" TextElement.FontSize="16" Margin="16,0,0,0">
<Label Margin="0" Padding="1" Content="1. Select 1 commit to view detail info"/>
<Label Margin="0" Padding="1" Content="2. Select 2 commits to show differences"/>
<Label Margin="0" Padding="1" Content="3. Select more than 2 commits to count"/>
</StackPanel>
</StackPanel>
</Border>
<!-- SWITCH LAYOUT -->
<ToggleButton
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Top" VerticalAlignment="Top"
Margin="0,4,8,0" Margin="0,4,0,0"
Orientation="Horizontal">
<!-- Layout Switch -->
<ToggleButton
Style="{StaticResource Style.ToggleButton.Orientation}" Style="{StaticResource Style.ToggleButton.Orientation}"
ToolTip="Toggle Horizontal/Vertical Layout" ToolTip="Toggle Horizontal/Vertical Layout"
IsChecked="{Binding Source={x:Static sourcegit:App.Preference}, Path=UIUseHorizontalLayout, Mode=TwoWay}" IsChecked="{Binding Source={x:Static sourcegit:App.Preference}, Path=UIUseHorizontalLayout, Mode=TwoWay}"
Checked="ChangeOrientation" Unchecked="ChangeOrientation"/> Checked="ChangeOrientation" Unchecked="ChangeOrientation"/>
<!-- Tips to Histories Panel -->
<Path
Width="20" Height="20"
Margin="8,0"
Style="{StaticResource Style.Icon}"
Data="{StaticResource Icon.Help}"
Fill="{StaticResource Brush.Border1}">
<Path.ToolTip>
<StackPanel Orientation="Vertical" TextElement.FontFamily="Consolas">
<Label Content="HISTORIES GUIDE" FontWeight="Bold" FontSize="14" Margin="0,0,0,8"/>
<Label Content="1. Select single commit to view detail"/>
<Label Content="2. Select two commits to show differences"/>
<Label Content="3. Select more than 2 commits to count"/>
</StackPanel>
</Path.ToolTip>
</Path>
</StackPanel>
</Grid> </Grid>
</Grid> </Grid>
</UserControl> </UserControl>

View file

@ -272,23 +272,24 @@ namespace SourceGit.UI {
} }
private void CommitSelectChanged(object sender, SelectionChangedEventArgs e) { private void CommitSelectChanged(object sender, SelectionChangedEventArgs e) {
selectionCounter.Visibility = Visibility.Collapsed; mask.Visibility = Visibility.Collapsed;
commitViewer.Visibility = Visibility.Collapsed; commitViewer.Visibility = Visibility.Collapsed;
twoCommitDiff.Visibility = Visibility.Collapsed; twoCommitDiff.Visibility = Visibility.Collapsed;
welcome.Visibility = Visibility.Collapsed;
var selected = commitList.SelectedItems; var selected = commitList.SelectedItems;
if (selected.Count == 0) { if (selected.Count == 1) {
welcome.Visibility = Visibility.Visible;
} else if (selected.Count == 1) {
commitViewer.Visibility = Visibility.Visible; commitViewer.Visibility = Visibility.Visible;
commitViewer.SetData(Repo, selected[0] as Git.Commit); commitViewer.SetData(Repo, selected[0] as Git.Commit);
} else if (selected.Count == 2) { } else if (selected.Count == 2) {
twoCommitDiff.Visibility = Visibility.Visible; twoCommitDiff.Visibility = Visibility.Visible;
twoCommitDiff.SetData(Repo, (selected[0] as Git.Commit).ShortSHA, (selected[1] as Git.Commit).ShortSHA); twoCommitDiff.SetData(Repo, (selected[0] as Git.Commit).ShortSHA, (selected[1] as Git.Commit).ShortSHA);
} else if (selected.Count > 2) {
mask.Visibility = Visibility.Visible;
txtCounter.Visibility = Visibility.Visible;
txtCounter.Content = $"SELECTED {selected.Count} COMMITS";
} else { } else {
selectionCounter.Visibility = Visibility.Visible; mask.Visibility = Visibility.Visible;
txtTotalSelected.Content = $"SELECTED {selected.Count} COMMITS"; txtCounter.Visibility = Visibility.Hidden;
} }
} }