mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-26 21:04:59 +00:00
refactor: remove move up/down button since we support to drag & drop items
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
e5bd166568
commit
6ea00a3111
2 changed files with 3 additions and 45 deletions
|
@ -88,8 +88,6 @@
|
|||
<ColumnDefinition Width="108"/>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="CommitHashColumn"/>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="CommitTimeColumn"/>
|
||||
<ColumnDefinition Width="32"/>
|
||||
<ColumnDefinition Width="32"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Drag & Drop Anchor -->
|
||||
|
@ -191,7 +189,7 @@
|
|||
<Grid Grid.Column="2" ColumnDefinitions="Auto,*" ClipToBounds="True">
|
||||
<Button Grid.Column="0"
|
||||
Classes="icon_button"
|
||||
Margin="0,0,8,0"
|
||||
Margin="0,0,6,0" Padding="0"
|
||||
IsVisible="{Binding Action, Converter={x:Static c:InteractiveRebaseActionConverters.CanEditMessage}}"
|
||||
Click="OnOpenCommitMessageEditor">
|
||||
<Path Width="14" Height="14" Margin="0,4,0,0" Data="{StaticResource Icons.Edit}"/>
|
||||
|
@ -214,27 +212,15 @@
|
|||
<!-- Commit SHA -->
|
||||
<Border Grid.Column="5" ClipToBounds="True">
|
||||
<TextBlock Classes="primary"
|
||||
Text="{Binding Commit.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}"
|
||||
HorizontalAlignment="Center"/>
|
||||
Text="{Binding Commit.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}"/>
|
||||
</Border>
|
||||
|
||||
<!-- Commit Time -->
|
||||
<Border Grid.Column="6">
|
||||
<TextBlock Classes="primary"
|
||||
Margin="16,0,8,0"
|
||||
Text="{Binding Commit.CommitterTimeStr}"
|
||||
HorizontalAlignment="Center"/>
|
||||
Text="{Binding Commit.CommitterTimeStr}"/>
|
||||
</Border>
|
||||
|
||||
<!-- MoveUp Button -->
|
||||
<Button Grid.Column="7" Classes="icon_button" Click="OnMoveItemUp" ToolTip.Tip="Alt+Up">
|
||||
<Path Width="14" Height="14" Margin="0,4,0,0" Data="{StaticResource Icons.Up}"/>
|
||||
</Button>
|
||||
|
||||
<!-- MoveDown Button -->
|
||||
<Button Grid.Column="8" Classes="icon_button" Click="OnMoveItemDown" ToolTip.Tip="Alt+Down">
|
||||
<Path Width="14" Height="14" Margin="0,4,0,0" Data="{StaticResource Icons.Down}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</v:InteractiveRebaseListBox.ItemTemplate>
|
||||
|
|
|
@ -57,16 +57,6 @@ namespace SourceGit.Views
|
|||
vm.ChangeAction(item, Models.InteractiveRebaseAction.Drop);
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.KeyModifiers == KeyModifiers.Alt && e.Key == Key.Up)
|
||||
{
|
||||
vm.MoveItemUp(item);
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.KeyModifiers == KeyModifiers.Alt && e.Key == Key.Down)
|
||||
{
|
||||
vm.MoveItemDown(item);
|
||||
e.Handled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
base.OnKeyDown(e);
|
||||
|
@ -136,24 +126,6 @@ namespace SourceGit.Views
|
|||
}
|
||||
}
|
||||
|
||||
private void OnMoveItemUp(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Control control && DataContext is ViewModels.InteractiveRebase vm)
|
||||
{
|
||||
vm.MoveItemUp(control.DataContext as ViewModels.InteractiveRebaseItem);
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnMoveItemDown(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Control control && DataContext is ViewModels.InteractiveRebase vm)
|
||||
{
|
||||
vm.MoveItemDown(control.DataContext as ViewModels.InteractiveRebaseItem);
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnChangeRebaseAction(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.InteractiveRebase vm &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue