style<Histories>: remove commit detail panel's guide tips

This commit is contained in:
leo 2022-05-20 14:20:22 +08:00
parent 1da67dc517
commit 44ed55937d
4 changed files with 188 additions and 204 deletions

View file

@ -274,11 +274,6 @@
<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>
<sys:String x:Key="Text.Histories.Guide_2">2. Select two commits to show differences</sys:String>
<sys:String x:Key="Text.Histories.Guide_3">3. Select more than 2 commits to count</sys:String>
<sys:String x:Key="Text.Histories.Guide_4">4. Open context menu to see more options</sys:String>
<sys:String x:Key="Text.Init">Initialize Repository</sys:String>
<sys:String x:Key="Text.Init.Path">Path :</sys:String>

View file

@ -273,11 +273,6 @@
<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>
<sys:String x:Key="Text.Histories.Guide_1">1. 单选时,显示选中提交的详细信息</sys:String>
<sys:String x:Key="Text.Histories.Guide_2">2. 双选时,按选中顺序对比两个提交</sys:String>
<sys:String x:Key="Text.Histories.Guide_3">3. 多选时,仅统计选中行数</sys:String>
<sys:String x:Key="Text.Histories.Guide_4">4. 右键用于操作选中的某个提交</sys:String>
<sys:String x:Key="Text.Init">初始化新仓库</sys:String>
<sys:String x:Key="Text.Init.Path">路径 </sys:String>

View file

@ -1,193 +1,186 @@
<UserControl x:Class="SourceGit.Views.Widgets.Histories"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
xmlns:converters="clr-namespace:SourceGit.Views.Converters"
xmlns:models="clr-namespace:SourceGit.Models"
xmlns:widgets="clr-namespace:SourceGit.Views.Widgets"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid x:Name="layout">
<Grid.Resources>
<converters:BoolToCollapsed x:Key="BoolToCollapsed"/>
</Grid.Resources>
<Border x:Name="commitListPanel" Background="{DynamicResource Brush.Contents}">
<Grid ClipToBounds="True">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- SearchBar -->
<Grid Grid.Row="0" x:Name="searchBar" Margin="0,-32,0,0">
<controls:TextEdit
x:Name="txtSearch"
Margin="4" Padding="0,0,22,0"
Height="24"
Placeholder="{DynamicResource Text.Histories.Search}"
PreviewKeyDown="OnSearchPreviewKeyDown"/>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="8,0">
<controls:IconButton
Click="ClearSearch"
Width="14" Height="14"
Icon="{StaticResource Icon.Clear}"
Foreground="{DynamicResource Brush.FG2}"
ToolTip="{DynamicResource Text.Histories.SearchClear}"/>
<controls:IconButton
Click="HideSearch"
Width="14" Height="14" Margin="6,0,0,0"
Icon="{StaticResource Icon.Up}"
Foreground="{DynamicResource Brush.FG2}"
ToolTip="{DynamicResource Text.Close}"/>
</StackPanel>
</Grid>
<!-- Commit DataGrid -->
<DataGrid
Grid.Row="1"
x:Name="commitList"
RowHeight="24"
SelectionUnit="FullRow"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.ScrollChanged="OnCommitListScrolled"
SelectionChanged="OnCommitSelectionChanged"
KeyUp="OnCommitListKeyUp">
<DataGrid.Columns>
<DataGridTemplateColumn x:Name="graphColumn" Width="*" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="{Binding Margin}">
<ItemsControl ItemsSource="{Binding Decorators}" Visibility="{Binding HasDecorators, Converter={StaticResource BoolToCollapsed}}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" VerticalAlignment="Center"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type models:Decorator}">
<StackPanel Orientation="Horizontal" Height="16" Margin="2,0">
<Border Background="{DynamicResource Brush.Decorator}">
<Path x:Name="Icon" Margin="4,0" Width="8" Height="8" Data="{StaticResource Icon.Branch}" Fill="{DynamicResource Brush.DecoratorIcon}"/>
</Border>
<Border x:Name="Color" Background="#FFFFB835">
<TextBlock Text="{Binding Name}" FontSize="8pt" Margin="4,0" Foreground="Black"/>
</Border>
</StackPanel>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Type}" Value="{x:Static models:DecoratorType.CurrentBranchHead}">
<Setter TargetName="Icon" Property="Data" Value="{StaticResource Icon.Check}"/>
</DataTrigger>
<DataTrigger Binding="{Binding Type}" Value="{x:Static models:DecoratorType.RemoteBranchHead}">
<Setter TargetName="Icon" Property="Data" Value="{StaticResource Icon.Remote}"/>
</DataTrigger>
<DataTrigger Binding="{Binding Type}" Value="{x:Static models:DecoratorType.Tag}">
<Setter TargetName="Color" Property="Background" Value="#FF02C302"/>
<Setter TargetName="Icon" Property="Data" Value="{StaticResource Icon.Tag}"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="{Binding Subject}" FontSize="13" Margin="2,0,0,0"/>
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="32" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<controls:Avatar
Width="16" Height="16"
HorizontalAlignment="Center" VerticalAlignment="Center"
Email="{Binding Committer.Email}"
FallbackLabel="{Binding Committer.Name}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="80" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Committer.Name}" Margin="0,0,8,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="72" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding ShortSHA}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="140" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Committer.Time}" HorizontalAlignment="Right" Margin="0,0,4,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
<DataGrid.RowStyle>
<Style TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource Style.DataGridRow}">
<EventSetter Event="ContextMenuOpening" Handler="OnCommitContextMenuOpening"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsMerged}" Value="False">
<Setter Property="Opacity" Value=".5"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
</DataGrid>
<!-- Commit Graph -->
<controls:CommitGraph Grid.Row="1" x:Name="graph" Width="{Binding ElementName=graphColumn, Path=ActualWidth}" HorizontalAlignment="Left"/>
<!-- Loading Tip -->
<controls:Loading Grid.Row="1" Width="48" Height="48" x:Name="loading" Visibility="Collapsed" Opacity=".4"/>
</Grid>
</Border>
<GridSplitter x:Name="splitter" Background="{DynamicResource Brush.Border0}"/>
<Grid x:Name="inspector">
<!-- Commit Detail -->
<widgets:CommitDetail x:Name="commitDetail"/>
<!-- Differents Between Two Revisions -->
<widgets:RevisionCompare x:Name="revisionCompare"/>
<!-- Mask -->
<Border x:Name="mask" Background="{DynamicResource Brush.Window}">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" Opacity=".25">
<Path Width="128" Height="128" Data="{StaticResource Icon.Detail}"/>
<TextBlock
x:Name="txtCounter"
Margin="0,16"
FontSize="24" FontWeight="UltraBold"
HorizontalAlignment="Center"
Text="{DynamicResource Text.Histories.Guide}"/>
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<TextBlock Text="{DynamicResource Text.Histories.Guide_1}" FontSize="14" Margin="0,2"/>
<TextBlock Text="{DynamicResource Text.Histories.Guide_2}" FontSize="14" Margin="0,2"/>
<TextBlock Text="{DynamicResource Text.Histories.Guide_3}" FontSize="14" Margin="0,2"/>
<TextBlock Text="{DynamicResource Text.Histories.Guide_4}" FontSize="14" Margin="0,2"/>
</StackPanel>
</StackPanel>
</Border>
</Grid>
</Grid>
</UserControl>
<UserControl x:Class="SourceGit.Views.Widgets.Histories"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
xmlns:converters="clr-namespace:SourceGit.Views.Converters"
xmlns:models="clr-namespace:SourceGit.Models"
xmlns:widgets="clr-namespace:SourceGit.Views.Widgets"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid x:Name="layout">
<Grid.Resources>
<converters:BoolToCollapsed x:Key="BoolToCollapsed"/>
</Grid.Resources>
<Border x:Name="commitListPanel" Background="{DynamicResource Brush.Contents}">
<Grid ClipToBounds="True">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- SearchBar -->
<Grid Grid.Row="0" x:Name="searchBar" Margin="0,-32,0,0">
<controls:TextEdit
x:Name="txtSearch"
Margin="4" Padding="0,0,22,0"
Height="24"
Placeholder="{DynamicResource Text.Histories.Search}"
PreviewKeyDown="OnSearchPreviewKeyDown"/>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="8,0">
<controls:IconButton
Click="ClearSearch"
Width="14" Height="14"
Icon="{StaticResource Icon.Clear}"
Foreground="{DynamicResource Brush.FG2}"
ToolTip="{DynamicResource Text.Histories.SearchClear}"/>
<controls:IconButton
Click="HideSearch"
Width="14" Height="14" Margin="6,0,0,0"
Icon="{StaticResource Icon.Up}"
Foreground="{DynamicResource Brush.FG2}"
ToolTip="{DynamicResource Text.Close}"/>
</StackPanel>
</Grid>
<!-- Commit DataGrid -->
<DataGrid
Grid.Row="1"
x:Name="commitList"
RowHeight="24"
SelectionUnit="FullRow"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.ScrollChanged="OnCommitListScrolled"
SelectionChanged="OnCommitSelectionChanged"
KeyUp="OnCommitListKeyUp">
<DataGrid.Columns>
<DataGridTemplateColumn x:Name="graphColumn" Width="*" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="{Binding Margin}">
<ItemsControl ItemsSource="{Binding Decorators}" Visibility="{Binding HasDecorators, Converter={StaticResource BoolToCollapsed}}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" VerticalAlignment="Center"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type models:Decorator}">
<StackPanel Orientation="Horizontal" Height="16" Margin="2,0">
<Border Background="{DynamicResource Brush.Decorator}">
<Path x:Name="Icon" Margin="4,0" Width="8" Height="8" Data="{StaticResource Icon.Branch}" Fill="{DynamicResource Brush.DecoratorIcon}"/>
</Border>
<Border x:Name="Color" Background="#FFFFB835">
<TextBlock Text="{Binding Name}" FontSize="8pt" Margin="4,0" Foreground="Black"/>
</Border>
</StackPanel>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Type}" Value="{x:Static models:DecoratorType.CurrentBranchHead}">
<Setter TargetName="Icon" Property="Data" Value="{StaticResource Icon.Check}"/>
</DataTrigger>
<DataTrigger Binding="{Binding Type}" Value="{x:Static models:DecoratorType.RemoteBranchHead}">
<Setter TargetName="Icon" Property="Data" Value="{StaticResource Icon.Remote}"/>
</DataTrigger>
<DataTrigger Binding="{Binding Type}" Value="{x:Static models:DecoratorType.Tag}">
<Setter TargetName="Color" Property="Background" Value="#FF02C302"/>
<Setter TargetName="Icon" Property="Data" Value="{StaticResource Icon.Tag}"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="{Binding Subject}" FontSize="13" Margin="2,0,0,0"/>
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="32" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<controls:Avatar
Width="16" Height="16"
HorizontalAlignment="Center" VerticalAlignment="Center"
Email="{Binding Committer.Email}"
FallbackLabel="{Binding Committer.Name}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="80" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Committer.Name}" Margin="0,0,8,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="72" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding ShortSHA}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="140" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Committer.Time}" HorizontalAlignment="Right" Margin="0,0,4,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
<DataGrid.RowStyle>
<Style TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource Style.DataGridRow}">
<EventSetter Event="ContextMenuOpening" Handler="OnCommitContextMenuOpening"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsMerged}" Value="False">
<Setter Property="Opacity" Value=".5"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
</DataGrid>
<!-- Commit Graph -->
<controls:CommitGraph Grid.Row="1" x:Name="graph" Width="{Binding ElementName=graphColumn, Path=ActualWidth}" HorizontalAlignment="Left"/>
<!-- Loading Tip -->
<controls:Loading Grid.Row="1" Width="48" Height="48" x:Name="loading" Visibility="Collapsed" Opacity=".4"/>
</Grid>
</Border>
<GridSplitter x:Name="splitter" Background="{DynamicResource Brush.Border0}"/>
<Grid x:Name="inspector">
<!-- Commit Detail -->
<widgets:CommitDetail x:Name="commitDetail"/>
<!-- Differents Between Two Revisions -->
<widgets:RevisionCompare x:Name="revisionCompare"/>
<!-- Mask -->
<Border x:Name="mask" Background="{DynamicResource Brush.Window}">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" Opacity=".25">
<Path Width="128" Height="128" Data="{StaticResource Icon.Detail}"/>
<TextBlock
x:Name="txtCounter"
Margin="0,16"
FontSize="24" FontWeight="UltraBold"
HorizontalAlignment="Center"
Visibility="Collapsed"/>
</StackPanel>
</Border>
</Grid>
</Grid>
</UserControl>

View file

@ -236,9 +236,10 @@ namespace SourceGit.Views.Widgets {
} else if (selected.Count > 2) {
mask.Visibility = Visibility.Visible;
txtCounter.Text = App.Text("Histories.Selected", selected.Count);
txtCounter.Visibility = Visibility.Visible;
} else {
mask.Visibility = Visibility.Visible;
txtCounter.Text = App.Text("Histories.Guide");
txtCounter.Visibility = Visibility.Collapsed;
}
}