mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
updated toggle game mode
This commit is contained in:
parent
476d2058a2
commit
8102a53d48
4 changed files with 11 additions and 24 deletions
|
|
@ -104,9 +104,6 @@
|
|||
<ProjectReference Include="..\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="Images\gamemode.ico" />
|
||||
</ItemGroup>
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="taskkill /f /fi "IMAGENAME eq Flow.Launcher.exe"" />
|
||||
</Target>
|
||||
|
|
|
|||
|
|
@ -6,13 +6,10 @@ using NHotkey.Wpf;
|
|||
using Flow.Launcher.Core.Resource;
|
||||
using System.Windows;
|
||||
using Flow.Launcher.ViewModel;
|
||||
using Flow.Launcher;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
|
||||
namespace Flow.Launcher.Helper
|
||||
{
|
||||
internal class HotKeyMapper
|
||||
internal static class HotKeyMapper
|
||||
{
|
||||
private static Settings settings;
|
||||
private static MainViewModel mainViewModel;
|
||||
|
|
@ -28,13 +25,8 @@ namespace Flow.Launcher.Helper
|
|||
|
||||
internal static void OnToggleHotkey(object sender, HotkeyEventArgs args)
|
||||
{
|
||||
if (mainViewModel.gameModeStatus == true)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!mainViewModel.GameModeStatus)
|
||||
mainViewModel.ToggleFlowLauncher();
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetHotkey(string hotkeyStr, EventHandler<HotkeyEventArgs> action)
|
||||
|
|
@ -82,7 +74,7 @@ namespace Flow.Launcher.Helper
|
|||
{
|
||||
SetHotkey(hotkey.Hotkey, (s, e) =>
|
||||
{
|
||||
if (mainViewModel.ShouldIgnoreHotkeys() || mainViewModel.gameModeStatus == true)
|
||||
if (mainViewModel.ShouldIgnoreHotkeys() || mainViewModel.GameModeStatus)
|
||||
return;
|
||||
|
||||
mainViewModel.MainWindowVisibility = Visibility.Visible;
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ namespace Flow.Launcher
|
|||
};
|
||||
|
||||
open.Click += (o, e) => Visibility = Visibility.Visible;
|
||||
gamemode.Click += (o, e) => GameMode();
|
||||
gamemode.Click += (o, e) => ToggleGameMode();
|
||||
settings.Click += (o, e) => App.API.OpenSettingDialog();
|
||||
exit.Click += (o, e) => Close();
|
||||
contextMenu.Items.Add(header);
|
||||
|
|
@ -227,17 +227,17 @@ namespace Flow.Launcher
|
|||
};
|
||||
}
|
||||
|
||||
public void GameMode()
|
||||
private void ToggleGameMode()
|
||||
{
|
||||
if (_viewModel.gameModeStatus)
|
||||
if (_viewModel.GameModeStatus)
|
||||
{
|
||||
_notifyIcon.Icon = Properties.Resources.app;
|
||||
_viewModel.gameModeStatus = false;
|
||||
_viewModel.GameModeStatus = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_notifyIcon.Icon = Properties.Resources.gamemode;
|
||||
_viewModel.gameModeStatus = true;
|
||||
_viewModel.GameModeStatus = true;
|
||||
}
|
||||
}
|
||||
private void InitProgressbarAnimation()
|
||||
|
|
|
|||
|
|
@ -20,9 +20,6 @@ using Flow.Launcher.Infrastructure.Logger;
|
|||
using Microsoft.VisualStudio.Threading;
|
||||
using System.Threading.Channels;
|
||||
using ISavable = Flow.Launcher.Plugin.ISavable;
|
||||
using System.Windows.Threading;
|
||||
using NHotkey;
|
||||
using Windows.Web.Syndication;
|
||||
|
||||
|
||||
namespace Flow.Launcher.ViewModel
|
||||
|
|
@ -44,7 +41,6 @@ namespace Flow.Launcher.ViewModel
|
|||
private readonly History _history;
|
||||
private readonly UserSelectedRecord _userSelectedRecord;
|
||||
private readonly TopMostRecord _topMostRecord;
|
||||
private MainWindow _mainWindow;
|
||||
|
||||
private CancellationTokenSource _updateSource;
|
||||
private CancellationToken _updateToken;
|
||||
|
|
@ -302,10 +298,12 @@ namespace Flow.Launcher.ViewModel
|
|||
#region ViewModel Properties
|
||||
|
||||
public ResultsViewModel Results { get; private set; }
|
||||
|
||||
public ResultsViewModel ContextMenu { get; private set; }
|
||||
|
||||
public ResultsViewModel History { get; private set; }
|
||||
|
||||
public bool gameModeStatus = false;
|
||||
public bool GameModeStatus { get; set; }
|
||||
|
||||
private string _queryText;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue