update to constants and change method name to OpenThemeFolder

This commit is contained in:
Jeremy 2021-11-29 08:07:08 +11:00
parent 9297bac72f
commit 83feb096c8
5 changed files with 13 additions and 13 deletions

View file

@ -35,6 +35,10 @@ namespace Flow.Launcher.Infrastructure
public const string DefaultTheme = "Win11Light";
public const string Light = "Light";
public const string Dark = "Dark";
public const string System = "System";
public const string Themes = "Themes";
public const string Settings = "Settings";
public const string Logs = "Logs";

View file

@ -16,6 +16,7 @@ using ContextMenuStrip = System.Windows.Forms.ContextMenuStrip;
using DragEventArgs = System.Windows.DragEventArgs;
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
using NotifyIcon = System.Windows.Forms.NotifyIcon;
using Flow.Launcher.Infrastructure;
namespace Flow.Launcher
{
@ -480,16 +481,14 @@ namespace Flow.Launcher
public void InitializeDarkMode()
{
if (_settings.DarkMode == "Light")
if (_settings.DarkMode == Constant.Light)
{
ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Light;
}
else if (_settings.DarkMode == "Dark")
else if (_settings.DarkMode == Constant.Dark)
{
ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Dark;
}
else
{ }
}
}
}

View file

@ -1949,7 +1949,7 @@
Width="180"
Margin="0,0,18,0"
HorizontalAlignment="Center"
Click="OpenPluginFolder"
Click="OpenThemeFolder"
Content="{DynamicResource OpenThemeFolder}"
DockPanel.Dock="Top" />
<TextBlock Style="{StaticResource Glyph}">

View file

@ -265,7 +265,7 @@ namespace Flow.Launcher
Close();
}
private void OpenPluginFolder(object sender, RoutedEventArgs e)
private void OpenThemeFolder(object sender, RoutedEventArgs e)
{
PluginManager.API.OpenDirectory(Path.Combine(DataLocation.DataDirectory(), Constant.Themes));
}
@ -277,7 +277,7 @@ namespace Flow.Launcher
private void OpenLogFolder(object sender, RoutedEventArgs e)
{
PluginManager.API.OpenDirectory(Path.Combine(DataLocation.DataDirectory(), Constant.Logs));
PluginManager.API.OpenDirectory(Path.Combine(DataLocation.DataDirectory(), Constant.Logs, Constant.Version));
}
private void OnPluginStoreRefreshClick(object sender, RoutedEventArgs e)
@ -308,9 +308,9 @@ namespace Flow.Launcher
private void DarkModeSelectedIndexChanged(object sender, EventArgs e) => ThemeManager.Current.ApplicationTheme = settings.DarkMode switch
{
"Light" => ApplicationTheme.Light,
"Dark" => ApplicationTheme.Dark,
"System" => null,
Constant.Light => ApplicationTheme.Light,
Constant.Dark => ApplicationTheme.Dark,
Constant.System => null,
_ => ThemeManager.Current.ApplicationTheme
};

View file

@ -15,12 +15,10 @@ using Flow.Launcher.Core.Plugin;
using Flow.Launcher.Core.Resource;
using Flow.Launcher.Helper;
using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.Image;
using Flow.Launcher.Infrastructure.Storage;
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin;
using Flow.Launcher.Plugin.SharedModels;
using ApplicationTheme = ModernWpf.ApplicationTheme;
namespace Flow.Launcher.ViewModel
{
@ -387,7 +385,6 @@ namespace Flow.Launcher.ViewModel
}
}
public ResultsViewModel PreviewResults
{
get