File tree Expand file tree Collapse file tree 4 files changed +11
-24
lines changed Expand file tree Collapse file tree 4 files changed +11
-24
lines changed Original file line number Diff line number Diff line change 104104 <ProjectReference Include =" ..\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj" />
105105 </ItemGroup >
106106
107- <ItemGroup >
108- <Resource Include =" Images\gamemode.ico" />
109- </ItemGroup >
110107 <Target Name =" PreBuild" BeforeTargets =" PreBuildEvent" >
111108 <Exec Command =" taskkill /f /fi " IMAGENAME eq Flow.Launcher.exe" " />
112109 </Target >
Original file line number Diff line number Diff line change 66using Flow . Launcher . Core . Resource ;
77using System . Windows ;
88using Flow . Launcher . ViewModel ;
9- using Flow . Launcher ;
10- using System . Threading . Tasks ;
11- using System . Threading ;
129
1310namespace Flow . Launcher . Helper
1411{
15- internal class HotKeyMapper
12+ internal static class HotKeyMapper
1613 {
1714 private static Settings settings ;
1815 private static MainViewModel mainViewModel ;
@@ -28,13 +25,8 @@ internal static void Initialize(MainViewModel mainVM)
2825
2926 internal static void OnToggleHotkey ( object sender , HotkeyEventArgs args )
3027 {
31- if ( mainViewModel . gameModeStatus == true )
32- {
33- }
34- else
35- {
28+ if ( ! mainViewModel . GameModeStatus )
3629 mainViewModel . ToggleFlowLauncher ( ) ;
37- }
3830 }
3931
4032 private static void SetHotkey ( string hotkeyStr , EventHandler < HotkeyEventArgs > action )
@@ -82,7 +74,7 @@ internal static void SetCustomQueryHotkey(CustomPluginHotkey hotkey)
8274 {
8375 SetHotkey ( hotkey . Hotkey , ( s , e ) =>
8476 {
85- if ( mainViewModel . ShouldIgnoreHotkeys ( ) || mainViewModel . gameModeStatus == true )
77+ if ( mainViewModel . ShouldIgnoreHotkeys ( ) || mainViewModel . GameModeStatus )
8678 return ;
8779
8880 mainViewModel . MainWindowVisibility = Visibility . Visible ;
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ private void InitializeNotifyIcon()
202202 } ;
203203
204204 open . Click += ( o , e ) => Visibility = Visibility . Visible ;
205- gamemode . Click += ( o , e ) => GameMode ( ) ;
205+ gamemode . Click += ( o , e ) => ToggleGameMode ( ) ;
206206 settings . Click += ( o , e ) => App . API . OpenSettingDialog ( ) ;
207207 exit . Click += ( o , e ) => Close ( ) ;
208208 contextMenu . Items . Add ( header ) ;
@@ -227,17 +227,17 @@ private void InitializeNotifyIcon()
227227 } ;
228228 }
229229
230- public void GameMode ( )
230+ private void ToggleGameMode ( )
231231 {
232- if ( _viewModel . gameModeStatus )
232+ if ( _viewModel . GameModeStatus )
233233 {
234234 _notifyIcon . Icon = Properties . Resources . app ;
235- _viewModel . gameModeStatus = false ;
235+ _viewModel . GameModeStatus = false ;
236236 }
237237 else
238238 {
239239 _notifyIcon . Icon = Properties . Resources . gamemode ;
240- _viewModel . gameModeStatus = true ;
240+ _viewModel . GameModeStatus = true ;
241241 }
242242 }
243243 private void InitProgressbarAnimation ( )
Original file line number Diff line number Diff line change 2020using Microsoft . VisualStudio . Threading ;
2121using System . Threading . Channels ;
2222using ISavable = Flow . Launcher . Plugin . ISavable ;
23- using System . Windows . Threading ;
24- using NHotkey ;
25- using Windows . Web . Syndication ;
2623
2724
2825namespace Flow . Launcher . ViewModel
@@ -44,7 +41,6 @@ public class MainViewModel : BaseModel, ISavable
4441 private readonly History _history ;
4542 private readonly UserSelectedRecord _userSelectedRecord ;
4643 private readonly TopMostRecord _topMostRecord ;
47- private MainWindow _mainWindow ;
4844
4945 private CancellationTokenSource _updateSource ;
5046 private CancellationToken _updateToken ;
@@ -302,10 +298,12 @@ private void InitializeKeyCommands()
302298 #region ViewModel Properties
303299
304300 public ResultsViewModel Results { get ; private set ; }
301+
305302 public ResultsViewModel ContextMenu { get ; private set ; }
303+
306304 public ResultsViewModel History { get ; private set ; }
307305
308- public bool gameModeStatus = false ;
306+ public bool GameModeStatus { get ; set ; }
309307
310308 private string _queryText ;
311309
You can’t perform that action at this time.
0 commit comments