mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Initial support
This commit is contained in:
parent
96bcf1b1f0
commit
9d94507e16
2 changed files with 31 additions and 0 deletions
|
|
@ -46,6 +46,10 @@
|
|||
Key="Tab"
|
||||
Command="{Binding SelectPrevItemCommand}"
|
||||
Modifiers="Shift" />
|
||||
<KeyBinding
|
||||
Key="C"
|
||||
Command="{Binding CopyToClipboard}"
|
||||
Modifiers="Ctrl" />
|
||||
<KeyBinding
|
||||
Key="I"
|
||||
Command="{Binding OpenSettingCommand}"
|
||||
|
|
|
|||
|
|
@ -189,6 +189,32 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
SelectFirstResultCommand = new RelayCommand(_ => SelectedResults.SelectFirstResult());
|
||||
|
||||
CopyToClipboard = new RelayCommand(index =>
|
||||
{
|
||||
var results = SelectedResults;
|
||||
|
||||
if (index != null)
|
||||
{
|
||||
results.SelectedIndex = int.Parse(index.ToString());
|
||||
}
|
||||
|
||||
var result = results.SelectedItem?.Result;
|
||||
if (result != null) // SelectedItem returns null if selection is empty.
|
||||
{
|
||||
bool hideWindow = result.Action != null && result.Action(new ActionContext
|
||||
{
|
||||
SpecialKeyState = GlobalHotkey.Instance.CheckModifiers()
|
||||
});
|
||||
Clipboard.SetText(result.Title.ToString());
|
||||
if (hideWindow)
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
StartHelpCommand = new RelayCommand(_ =>
|
||||
{
|
||||
SearchWeb.NewTabInBrowser("https://github.com/Flow-Launcher/Flow.Launcher/wiki/Flow-Launcher/");
|
||||
|
|
@ -383,6 +409,7 @@ namespace Flow.Launcher.ViewModel
|
|||
public ICommand OpenSettingCommand { get; set; }
|
||||
public ICommand ReloadPluginDataCommand { get; set; }
|
||||
public ICommand ClearQueryCommand { get; private set; }
|
||||
public ICommand CopyToClipboard { get; set; }
|
||||
|
||||
public string OpenResultCommandModifiers { get; private set; }
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue