mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-28 15:45:00 +00:00
feature: supports sort branches by committer date (#1192)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
b7fa04d141
commit
e45e37d305
10 changed files with 217 additions and 20 deletions
|
@ -202,9 +202,20 @@
|
|||
<Grid Grid.Row="2" x:Name="LeftSidebarGroups" Margin="0,4,0,0" RowDefinitions="28,Auto,28,Auto,28,Auto,28,Auto,28,Auto" SizeChanged="OnLeftSidebarSizeChanged">
|
||||
<!-- Local Branches -->
|
||||
<ToggleButton Grid.Row="0" Classes="group_expander" IsChecked="{Binding IsLocalBranchGroupExpanded, Mode=TwoWay}">
|
||||
<Grid ColumnDefinitions="16,*">
|
||||
<Grid ColumnDefinitions="16,*,Auto,Auto">
|
||||
<Path Grid.Column="0" Width="11" Height="11" HorizontalAlignment="Left" Data="{StaticResource Icons.Local}" Fill="{DynamicResource Brush.FG2}"/>
|
||||
<TextBlock Grid.Column="1" Classes="group_header_label" Margin="0" Text="{DynamicResource Text.Repository.LocalBranches}"/>
|
||||
<Button Grid.Column="2"
|
||||
Classes="icon_button"
|
||||
Width="14"
|
||||
Margin="8,0,0,0"
|
||||
Click="OnOpenSortLocalBranchMenu"
|
||||
ToolTip.Tip="{DynamicResource Text.Repository.BranchSort}">
|
||||
<Path Width="12" Height="12" Data="{StaticResource Icons.Order}"/>
|
||||
</Button>
|
||||
<Button Grid.Column="3" Classes="icon_button" Width="14" Margin="8,0" Command="{Binding CreateNewBranch}" ToolTip.Tip="{DynamicResource Text.Repository.NewBranch}">
|
||||
<Path Width="12" Height="12" Data="{StaticResource Icons.Branch.Add}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</ToggleButton>
|
||||
<v:BranchTree Grid.Row="1"
|
||||
|
@ -218,10 +229,18 @@
|
|||
|
||||
<!-- Remotes -->
|
||||
<ToggleButton Grid.Row="2" Classes="group_expander" IsChecked="{Binding IsRemoteGroupExpanded, Mode=TwoWay}">
|
||||
<Grid ColumnDefinitions="16,*,Auto">
|
||||
<Grid ColumnDefinitions="16,*,Auto,Auto">
|
||||
<Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Data="{StaticResource Icons.Remotes}" Fill="{DynamicResource Brush.FG2}"/>
|
||||
<TextBlock Grid.Column="1" Classes="group_header_label" Margin="0" Text="{DynamicResource Text.Repository.Remotes}"/>
|
||||
<Button Grid.Column="2" Classes="icon_button" Width="14" Margin="8,0" Command="{Binding AddRemote}" ToolTip.Tip="{DynamicResource Text.Repository.Remotes.Add}">
|
||||
<Button Grid.Column="2"
|
||||
Classes="icon_button"
|
||||
Width="14"
|
||||
Margin="8,0,0,0"
|
||||
Click="OnOpenSortRemoteBranchMenu"
|
||||
ToolTip.Tip="{DynamicResource Text.Repository.BranchSort}">
|
||||
<Path Width="12" Height="12" Data="{StaticResource Icons.Order}"/>
|
||||
</Button>
|
||||
<Button Grid.Column="3" Classes="icon_button" Width="14" Margin="8,0" Command="{Binding AddRemote}" ToolTip.Tip="{DynamicResource Text.Repository.Remotes.Add}">
|
||||
<Path Width="12" Height="12" Data="{StaticResource Icons.Remote.Add}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
|
|
@ -403,6 +403,28 @@ namespace SourceGit.Views
|
|||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnOpenSortLocalBranchMenu(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button && DataContext is ViewModels.Repository repo)
|
||||
{
|
||||
var menu = repo.CreateContextMenuForBranchSortMode(true);
|
||||
menu?.Open(button);
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnOpenSortRemoteBranchMenu(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button && DataContext is ViewModels.Repository repo)
|
||||
{
|
||||
var menu = repo.CreateContextMenuForBranchSortMode(false);
|
||||
menu?.Open(button);
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnOpenSortTagMenu(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button && DataContext is ViewModels.Repository repo)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue