Skip to content

Commit 83feb09

Browse files
committed
update to constants and change method name to OpenThemeFolder
1 parent 9297bac commit 83feb09

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

Flow.Launcher.Infrastructure/Constant.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public static class Constant
3535

3636
public const string DefaultTheme = "Win11Light";
3737

38+
public const string Light = "Light";
39+
public const string Dark = "Dark";
40+
public const string System = "System";
41+
3842
public const string Themes = "Themes";
3943
public const string Settings = "Settings";
4044
public const string Logs = "Logs";

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using DragEventArgs = System.Windows.DragEventArgs;
1717
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
1818
using NotifyIcon = System.Windows.Forms.NotifyIcon;
19+
using Flow.Launcher.Infrastructure;
1920

2021
namespace Flow.Launcher
2122
{
@@ -480,16 +481,14 @@ private void MoveQueryTextToEnd()
480481

481482
public void InitializeDarkMode()
482483
{
483-
if (_settings.DarkMode == "Light")
484+
if (_settings.DarkMode == Constant.Light)
484485
{
485486
ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Light;
486487
}
487-
else if (_settings.DarkMode == "Dark")
488+
else if (_settings.DarkMode == Constant.Dark)
488489
{
489490
ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Dark;
490491
}
491-
else
492-
{ }
493492
}
494493
}
495494
}

Flow.Launcher/SettingWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1949,7 +1949,7 @@
19491949
Width="180"
19501950
Margin="0,0,18,0"
19511951
HorizontalAlignment="Center"
1952-
Click="OpenPluginFolder"
1952+
Click="OpenThemeFolder"
19531953
Content="{DynamicResource OpenThemeFolder}"
19541954
DockPanel.Dock="Top" />
19551955
<TextBlock Style="{StaticResource Glyph}">

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ private void OnCloseExecuted(object sender, ExecutedRoutedEventArgs e)
265265
Close();
266266
}
267267

268-
private void OpenPluginFolder(object sender, RoutedEventArgs e)
268+
private void OpenThemeFolder(object sender, RoutedEventArgs e)
269269
{
270270
PluginManager.API.OpenDirectory(Path.Combine(DataLocation.DataDirectory(), Constant.Themes));
271271
}
@@ -277,7 +277,7 @@ private void OpenSettingFolder(object sender, RoutedEventArgs e)
277277

278278
private void OpenLogFolder(object sender, RoutedEventArgs e)
279279
{
280-
PluginManager.API.OpenDirectory(Path.Combine(DataLocation.DataDirectory(), Constant.Logs));
280+
PluginManager.API.OpenDirectory(Path.Combine(DataLocation.DataDirectory(), Constant.Logs, Constant.Version));
281281
}
282282

283283
private void OnPluginStoreRefreshClick(object sender, RoutedEventArgs e)
@@ -308,9 +308,9 @@ private void OnExternalPluginInstallClick(object sender, RoutedEventArgs e)
308308

309309
private void DarkModeSelectedIndexChanged(object sender, EventArgs e) => ThemeManager.Current.ApplicationTheme = settings.DarkMode switch
310310
{
311-
"Light" => ApplicationTheme.Light,
312-
"Dark" => ApplicationTheme.Dark,
313-
"System" => null,
311+
Constant.Light => ApplicationTheme.Light,
312+
Constant.Dark => ApplicationTheme.Dark,
313+
Constant.System => null,
314314
_ => ThemeManager.Current.ApplicationTheme
315315
};
316316

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515
using Flow.Launcher.Core.Resource;
1616
using Flow.Launcher.Helper;
1717
using Flow.Launcher.Infrastructure;
18-
using Flow.Launcher.Infrastructure.Image;
1918
using Flow.Launcher.Infrastructure.Storage;
2019
using Flow.Launcher.Infrastructure.UserSettings;
2120
using Flow.Launcher.Plugin;
2221
using Flow.Launcher.Plugin.SharedModels;
23-
using ApplicationTheme = ModernWpf.ApplicationTheme;
2422

2523
namespace Flow.Launcher.ViewModel
2624
{
@@ -387,7 +385,6 @@ public Brush PreviewBackground
387385
}
388386
}
389387

390-
391388
public ResultsViewModel PreviewResults
392389
{
393390
get

0 commit comments

Comments
 (0)