Skip to content

Commit 89677ff

Browse files
committed
Merge branch 'RealFinalAnimation' of https://github.com/onesounds/Flow.Launcher into RealFinalAnimation
2 parents 3c78802 + 23ba5e9 commit 89677ff

File tree

7 files changed

+44
-12
lines changed

7 files changed

+44
-12
lines changed

Flow.Launcher/Helper/HotKeyMapper.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using Flow.Launcher.Core.Resource;
77
using System.Windows;
88
using Flow.Launcher.ViewModel;
9-
using System.Threading.Tasks;
10-
using System.Threading;
119

1210
namespace Flow.Launcher.Helper
1311
{
@@ -27,7 +25,8 @@ internal static void Initialize(MainViewModel mainVM)
2725

2826
internal static void OnToggleHotkey(object sender, HotkeyEventArgs args)
2927
{
30-
mainViewModel.ToggleFlowLauncher();
28+
if (!mainViewModel.GameModeStatus)
29+
mainViewModel.ToggleFlowLauncher();
3130
}
3231

3332
private static void SetHotkey(string hotkeyStr, EventHandler<HotkeyEventArgs> action)
@@ -75,7 +74,7 @@ internal static void SetCustomQueryHotkey(CustomPluginHotkey hotkey)
7574
{
7675
SetHotkey(hotkey.Hotkey, (s, e) =>
7776
{
78-
if (mainViewModel.ShouldIgnoreHotkeys())
77+
if (mainViewModel.ShouldIgnoreHotkeys() || mainViewModel.GameModeStatus)
7978
return;
8079

8180
mainViewModel.Show();

Flow.Launcher/Images/gamemode.ico

9.44 KB
Binary file not shown.

Flow.Launcher/Languages/en.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<system:String x:Key="iconTrayAbout">About</system:String>
1616
<system:String x:Key="iconTrayExit">Exit</system:String>
1717
<system:String x:Key="closeWindow">Close</system:String>
18+
<system:String x:Key="GameMode">Game Mode</system:String>
1819

1920
<!-- Setting General -->
2021
<system:String x:Key="flowlauncher_settings">Flow Launcher Settings</system:String>

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ private void UpdateNotifyIconText()
167167
{
168168
var menu = contextMenu;
169169
((MenuItem)menu.Items[1]).Header = InternationalizationManager.Instance.GetTranslation("iconTrayOpen");
170-
((MenuItem)menu.Items[2]).Header = InternationalizationManager.Instance.GetTranslation("iconTraySettings");
171-
((MenuItem)menu.Items[3]).Header = InternationalizationManager.Instance.GetTranslation("iconTrayExit");
170+
((MenuItem)menu.Items[2]).Header = InternationalizationManager.Instance.GetTranslation("GameMode");
171+
((MenuItem)menu.Items[3]).Header = InternationalizationManager.Instance.GetTranslation("iconTraySettings");
172+
((MenuItem)menu.Items[4]).Header = InternationalizationManager.Instance.GetTranslation("iconTrayExit");
172173
}
173174

174175
private void InitializeNotifyIcon()
@@ -190,6 +191,10 @@ private void InitializeNotifyIcon()
190191
{
191192
Header = InternationalizationManager.Instance.GetTranslation("iconTrayOpen")
192193
};
194+
var gamemode = new MenuItem
195+
{
196+
Header = InternationalizationManager.Instance.GetTranslation("GameMode")
197+
};
193198
var settings = new MenuItem
194199
{
195200
Header = InternationalizationManager.Instance.GetTranslation("iconTraySettings")
@@ -200,10 +205,12 @@ private void InitializeNotifyIcon()
200205
};
201206

202207
open.Click += (o, e) => _viewModel.ToggleFlowLauncher();
208+
gamemode.Click += (o, e) => ToggleGameMode();
203209
settings.Click += (o, e) => App.API.OpenSettingDialog();
204210
exit.Click += (o, e) => Close();
205211
contextMenu.Items.Add(header);
206212
contextMenu.Items.Add(open);
213+
contextMenu.Items.Add(gamemode);
207214
contextMenu.Items.Add(settings);
208215
contextMenu.Items.Add(exit);
209216

@@ -223,6 +230,19 @@ private void InitializeNotifyIcon()
223230
};
224231
}
225232

233+
private void ToggleGameMode()
234+
{
235+
if (_viewModel.GameModeStatus)
236+
{
237+
_notifyIcon.Icon = Properties.Resources.app;
238+
_viewModel.GameModeStatus = false;
239+
}
240+
else
241+
{
242+
_notifyIcon.Icon = Properties.Resources.gamemode;
243+
_viewModel.GameModeStatus = true;
244+
}
245+
}
226246
private void InitProgressbarAnimation()
227247
{
228248
var da = new DoubleAnimation(ProgressBar.X2, ActualWidth + 150,

Flow.Launcher/Properties/Resources.Designer.cs

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Flow.Launcher/Properties/Resources.resx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,16 @@
112112
<value>2.0</value>
113113
</resheader>
114114
<resheader name="reader">
115-
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
115+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116116
</resheader>
117117
<resheader name="writer">
118-
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
118+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120-
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
120+
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
121121
<data name="app" type="System.Resources.ResXFileRef, System.Windows.Forms">
122122
<value>..\Resources\app.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
123123
</data>
124+
<data name="gamemode" type="System.Resources.ResXFileRef, System.Windows.Forms">
125+
<value>..\Images\gamemode.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
126+
</data>
124127
</root>

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
using Microsoft.VisualStudio.Threading;
2121
using System.Threading.Channels;
2222
using ISavable = Flow.Launcher.Plugin.ISavable;
23-
using System.Windows.Threading;
24-
using NHotkey;
25-
using Windows.Web.Syndication;
2623

2724

2825
namespace Flow.Launcher.ViewModel
@@ -281,9 +278,13 @@ private void InitializeKeyCommands()
281278
#region ViewModel Properties
282279

283280
public ResultsViewModel Results { get; private set; }
281+
284282
public ResultsViewModel ContextMenu { get; private set; }
283+
285284
public ResultsViewModel History { get; private set; }
286285

286+
public bool GameModeStatus { get; set; }
287+
287288
private string _queryText;
288289

289290
public string QueryText

0 commit comments

Comments
 (0)