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.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.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.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">Initialize Repository</sys:String>
<sys:String x:Key="Text.Init.Path">Path :</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.GraphMode">切换曲线/折线显示</sys:String>
<sys:String x:Key="Text.Histories.DisplayMode">切换横向/纵向显示</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.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">初始化新仓库</sys:String>
<sys:String x:Key="Text.Init.Path">路径 </sys:String> <sys:String x:Key="Text.Init.Path">路径 </sys:String>

View file

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

View file

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