Merge pull request #89 from theClueless/addAltHomeforFirstResult

Addalthomeforfirstresult
This commit is contained in:
Jeremy Wu 2019-12-08 21:12:16 +11:00 committed by GitHub
commit 4d902c01a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -36,6 +36,7 @@
<KeyBinding Key="P" Modifiers="Ctrl" Command="{Binding SelectPrevItemCommand}"></KeyBinding>
<KeyBinding Key="K" Modifiers="Ctrl" Command="{Binding SelectPrevItemCommand}"></KeyBinding>
<KeyBinding Key="U" Modifiers="Ctrl" Command="{Binding SelectPrevPageCommand}"></KeyBinding>
<KeyBinding Key="Home" Modifiers="Alt" Command="{Binding SelectFirstResultCommand}"></KeyBinding>
<KeyBinding Key="O" Modifiers="Ctrl" Command="{Binding LoadContextMenuCommand}"></KeyBinding>
<KeyBinding Key="H" Modifiers="Ctrl" Command="{Binding LoadHistoryCommand}"></KeyBinding>
<KeyBinding Key="Enter" Modifiers="Shift" Command="{Binding LoadContextMenuCommand}"></KeyBinding>

View File

@ -126,6 +126,8 @@ namespace Wox.ViewModel
SelectedResults.SelectPrevPage();
});
SelectFirstResultCommand = new RelayCommand(_ => SelectedResults.SelectFirstResult());
StartHelpCommand = new RelayCommand(_ =>
{
Process.Start("http://doc.wox.one/");
@ -268,6 +270,7 @@ namespace Wox.ViewModel
public ICommand SelectPrevItemCommand { get; set; }
public ICommand SelectNextPageCommand { get; set; }
public ICommand SelectPrevPageCommand { get; set; }
public ICommand SelectFirstResultCommand { get; set; }
public ICommand StartHelpCommand { get; set; }
public ICommand LoadContextMenuCommand { get; set; }
public ICommand LoadHistoryCommand { get; set; }

View File

@ -107,6 +107,11 @@ namespace Wox.ViewModel
SelectedIndex = NewIndex(SelectedIndex - MaxResults);
}
public void SelectFirstResult()
{
SelectedIndex = NewIndex(0);
}
public void Clear()
{
Results.Clear();