mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Pull
This commit is contained in:
commit
1b4aa19051
3 changed files with 24 additions and 26 deletions
|
|
@ -5,6 +5,7 @@ using System.Drawing;
|
|||
using System.Text.Json.Serialization;
|
||||
using Flow.Launcher.Plugin;
|
||||
using Flow.Launcher.Plugin.SharedModels;
|
||||
using Flow.Launcher;
|
||||
using Flow.Launcher.ViewModel;
|
||||
|
||||
namespace Flow.Launcher.Infrastructure.UserSettings
|
||||
|
|
@ -41,7 +42,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
public int CustomExplorerIndex { get; set; } = 0;
|
||||
public CustomExplorerViewModel CustomExplorer
|
||||
{
|
||||
get => CustomExplorerList[CustomExplorerIndex];
|
||||
get => CustomExplorerList[CustomExplorerIndex < CustomExplorerList.Count ? CustomExplorerIndex : 0];
|
||||
set => CustomExplorerList[CustomExplorerIndex] = value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ namespace Flow.Launcher
|
|||
_viewModel.Save();
|
||||
e.Cancel = true;
|
||||
await PluginManager.DisposePluginsAsync();
|
||||
Application.Current.Shutdown();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
private void OnInitialized(object sender, EventArgs e)
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ namespace Flow.Launcher.ViewModel
|
|||
ReloadPluginDataCommand = new RelayCommand(_ =>
|
||||
{
|
||||
Hide();
|
||||
|
||||
|
||||
PluginManager
|
||||
.ReloadData()
|
||||
.ContinueWith(_ =>
|
||||
|
|
@ -323,7 +323,7 @@ namespace Flow.Launcher.ViewModel
|
|||
/// <param name="queryText"></param>
|
||||
public void ChangeQueryText(string queryText, bool reQuery = false)
|
||||
{
|
||||
if (QueryText!=queryText)
|
||||
if (QueryText != queryText)
|
||||
{
|
||||
// re-query is done in QueryText's setter method
|
||||
QueryText = queryText;
|
||||
|
|
@ -706,7 +706,7 @@ namespace Flow.Launcher.ViewModel
|
|||
OpenResultCommandModifiers = _settings.OpenResultModifiers ?? DefaultOpenResultModifiers;
|
||||
}
|
||||
|
||||
public async void ToggleFlowLauncher()
|
||||
public void ToggleFlowLauncher()
|
||||
{
|
||||
if (MainWindowVisibility != Visibility.Visible)
|
||||
{
|
||||
|
|
@ -714,33 +714,30 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
else
|
||||
{
|
||||
switch (_settings.LastQueryMode)
|
||||
{
|
||||
case LastQueryMode.Empty:
|
||||
ChangeQueryText(string.Empty);
|
||||
Application.Current.MainWindow.Opacity = 0; // Trick for no delay
|
||||
await Task.Delay(100);
|
||||
Application.Current.MainWindow.Opacity = 1;
|
||||
break;
|
||||
case LastQueryMode.Preserved:
|
||||
LastQuerySelected = true;
|
||||
break;
|
||||
case LastQueryMode.Selected:
|
||||
LastQuerySelected = false;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException($"wrong LastQueryMode: <{_settings.LastQueryMode}>");
|
||||
}
|
||||
MainWindowVisibility = Visibility.Collapsed;
|
||||
Hide();
|
||||
}
|
||||
}
|
||||
|
||||
public void Hide()
|
||||
public async void Hide()
|
||||
{
|
||||
if (MainWindowVisibility != Visibility.Collapsed)
|
||||
switch (_settings.LastQueryMode)
|
||||
{
|
||||
ToggleFlowLauncher();
|
||||
case LastQueryMode.Empty:
|
||||
ChangeQueryText(string.Empty);
|
||||
Application.Current.MainWindow.Opacity = 0; // Trick for no delay
|
||||
await Task.Delay(100);
|
||||
Application.Current.MainWindow.Opacity = 1;
|
||||
break;
|
||||
case LastQueryMode.Preserved:
|
||||
LastQuerySelected = true;
|
||||
break;
|
||||
case LastQueryMode.Selected:
|
||||
LastQuerySelected = false;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException($"wrong LastQueryMode: <{_settings.LastQueryMode}>");
|
||||
}
|
||||
MainWindowVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
Loading…
Reference in a new issue