mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
Merge pull request !5 from Jai/feature/shortcut-to-quick-stage
本地更改列表添加空格快捷键用于快速暂存/取消暂存选中的变更
This commit is contained in:
commit
faa93f6e9a
2 changed files with 11 additions and 0 deletions
|
@ -28,14 +28,17 @@
|
||||||
Visibility="Visible">
|
Visibility="Visible">
|
||||||
<TreeView.Resources>
|
<TreeView.Resources>
|
||||||
<RoutedUICommand x:Key="SelectWholeTreeCommand" Text="SelectWholeTree"/>
|
<RoutedUICommand x:Key="SelectWholeTreeCommand" Text="SelectWholeTree"/>
|
||||||
|
<RoutedUICommand x:Key="StageChangeCommand" Text="StageChange"/>
|
||||||
</TreeView.Resources>
|
</TreeView.Resources>
|
||||||
|
|
||||||
<TreeView.InputBindings>
|
<TreeView.InputBindings>
|
||||||
<KeyBinding Key="A" Modifiers="Ctrl" Command="{StaticResource SelectWholeTreeCommand}"/>
|
<KeyBinding Key="A" Modifiers="Ctrl" Command="{StaticResource SelectWholeTreeCommand}"/>
|
||||||
|
<KeyBinding Key="Space" Command="{StaticResource StageChangeCommand}"/>
|
||||||
</TreeView.InputBindings>
|
</TreeView.InputBindings>
|
||||||
|
|
||||||
<TreeView.CommandBindings>
|
<TreeView.CommandBindings>
|
||||||
<CommandBinding Command="{StaticResource SelectWholeTreeCommand}" Executed="SelectWholeTree"/>
|
<CommandBinding Command="{StaticResource SelectWholeTreeCommand}" Executed="SelectWholeTree"/>
|
||||||
|
<CommandBinding Command="{StaticResource StageChangeCommand}" Executed="StageChange"/>
|
||||||
</TreeView.CommandBindings>
|
</TreeView.CommandBindings>
|
||||||
|
|
||||||
<controls:Tree.ItemContainerStyle>
|
<controls:Tree.ItemContainerStyle>
|
||||||
|
|
|
@ -689,6 +689,14 @@ namespace SourceGit.Views.Widgets {
|
||||||
private void SelectWholeTree(object sender, ExecutedRoutedEventArgs e) {
|
private void SelectWholeTree(object sender, ExecutedRoutedEventArgs e) {
|
||||||
modeTree.SelectAll();
|
modeTree.SelectAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void StageChange(object sender, ExecutedRoutedEventArgs e) {
|
||||||
|
if (!IsUnstaged) {
|
||||||
|
UnstageSelected();
|
||||||
|
} else {
|
||||||
|
StageSelected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void OnTreeSelectionChanged(object sender, RoutedEventArgs e) {
|
private void OnTreeSelectionChanged(object sender, RoutedEventArgs e) {
|
||||||
if (Mode != Models.Change.DisplayMode.Tree) return;
|
if (Mode != Models.Change.DisplayMode.Tree) return;
|
||||||
|
|
Loading…
Reference in a new issue