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 104
104
<ProjectReference Include =" ..\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj" />
105
105
</ItemGroup >
106
106
107
- <ItemGroup >
108
- <Resource Include =" Images\gamemode.ico" />
109
- </ItemGroup >
110
107
<Target Name =" PreBuild" BeforeTargets =" PreBuildEvent" >
111
108
<Exec Command =" taskkill /f /fi " IMAGENAME eq Flow.Launcher.exe" " />
112
109
</Target >
Original file line number Diff line number Diff line change 6
6
using Flow . Launcher . Core . Resource ;
7
7
using System . Windows ;
8
8
using Flow . Launcher . ViewModel ;
9
- using Flow . Launcher ;
10
- using System . Threading . Tasks ;
11
- using System . Threading ;
12
9
13
10
namespace Flow . Launcher . Helper
14
11
{
15
- internal class HotKeyMapper
12
+ internal static class HotKeyMapper
16
13
{
17
14
private static Settings settings ;
18
15
private static MainViewModel mainViewModel ;
@@ -28,13 +25,8 @@ internal static void Initialize(MainViewModel mainVM)
28
25
29
26
internal static void OnToggleHotkey ( object sender , HotkeyEventArgs args )
30
27
{
31
- if ( mainViewModel . gameModeStatus == true )
32
- {
33
- }
34
- else
35
- {
28
+ if ( ! mainViewModel . GameModeStatus )
36
29
mainViewModel . ToggleFlowLauncher ( ) ;
37
- }
38
30
}
39
31
40
32
private static void SetHotkey ( string hotkeyStr , EventHandler < HotkeyEventArgs > action )
@@ -82,7 +74,7 @@ internal static void SetCustomQueryHotkey(CustomPluginHotkey hotkey)
82
74
{
83
75
SetHotkey ( hotkey . Hotkey , ( s , e ) =>
84
76
{
85
- if ( mainViewModel . ShouldIgnoreHotkeys ( ) || mainViewModel . gameModeStatus == true )
77
+ if ( mainViewModel . ShouldIgnoreHotkeys ( ) || mainViewModel . GameModeStatus )
86
78
return ;
87
79
88
80
mainViewModel . MainWindowVisibility = Visibility . Visible ;
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ private void InitializeNotifyIcon()
202
202
} ;
203
203
204
204
open . Click += ( o , e ) => Visibility = Visibility . Visible ;
205
- gamemode . Click += ( o , e ) => GameMode ( ) ;
205
+ gamemode . Click += ( o , e ) => ToggleGameMode ( ) ;
206
206
settings . Click += ( o , e ) => App . API . OpenSettingDialog ( ) ;
207
207
exit . Click += ( o , e ) => Close ( ) ;
208
208
contextMenu . Items . Add ( header ) ;
@@ -227,17 +227,17 @@ private void InitializeNotifyIcon()
227
227
} ;
228
228
}
229
229
230
- public void GameMode ( )
230
+ private void ToggleGameMode ( )
231
231
{
232
- if ( _viewModel . gameModeStatus )
232
+ if ( _viewModel . GameModeStatus )
233
233
{
234
234
_notifyIcon . Icon = Properties . Resources . app ;
235
- _viewModel . gameModeStatus = false ;
235
+ _viewModel . GameModeStatus = false ;
236
236
}
237
237
else
238
238
{
239
239
_notifyIcon . Icon = Properties . Resources . gamemode ;
240
- _viewModel . gameModeStatus = true ;
240
+ _viewModel . GameModeStatus = true ;
241
241
}
242
242
}
243
243
private void InitProgressbarAnimation ( )
Original file line number Diff line number Diff line change 20
20
using Microsoft . VisualStudio . Threading ;
21
21
using System . Threading . Channels ;
22
22
using ISavable = Flow . Launcher . Plugin . ISavable ;
23
- using System . Windows . Threading ;
24
- using NHotkey ;
25
- using Windows . Web . Syndication ;
26
23
27
24
28
25
namespace Flow . Launcher . ViewModel
@@ -44,7 +41,6 @@ public class MainViewModel : BaseModel, ISavable
44
41
private readonly History _history ;
45
42
private readonly UserSelectedRecord _userSelectedRecord ;
46
43
private readonly TopMostRecord _topMostRecord ;
47
- private MainWindow _mainWindow ;
48
44
49
45
private CancellationTokenSource _updateSource ;
50
46
private CancellationToken _updateToken ;
@@ -302,10 +298,12 @@ private void InitializeKeyCommands()
302
298
#region ViewModel Properties
303
299
304
300
public ResultsViewModel Results { get ; private set ; }
301
+
305
302
public ResultsViewModel ContextMenu { get ; private set ; }
303
+
306
304
public ResultsViewModel History { get ; private set ; }
307
305
308
- public bool gameModeStatus = false ;
306
+ public bool GameModeStatus { get ; set ; }
309
307
310
308
private string _queryText ;
311
309
You can’t perform that action at this time.
0 commit comments