Skip to content

Commit 59fbef1

Browse files
committed
Use public current theme
1 parent b2dc128 commit 59fbef1

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
using Flow.Launcher.Infrastructure;
1313
using Flow.Launcher.Infrastructure.Logger;
1414
using Flow.Launcher.Infrastructure.UserSettings;
15-
using CommunityToolkit.Mvvm.DependencyInjection;
1615
using Flow.Launcher.Plugin;
1716

1817
namespace Flow.Launcher.Core.Resource
@@ -35,6 +34,8 @@ public class Theme
3534
private string DirectoryPath => Path.Combine(Constant.ProgramDirectory, Folder);
3635
private string UserDirectoryPath => Path.Combine(DataLocation.DataDirectory(), Folder);
3736

37+
public string CurrentTheme => _settings.Theme;
38+
3839
public bool BlurEnabled { get; set; }
3940

4041
private double mainWindowWidth;

Plugins/Flow.Launcher.Plugin.Sys/ThemeSelector.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
using System.Linq;
44
using CommunityToolkit.Mvvm.DependencyInjection;
55
using Flow.Launcher.Core.Resource;
6-
using Flow.Launcher.Infrastructure.UserSettings;
76

87
namespace Flow.Launcher.Plugin.Sys
98
{
109
public class ThemeSelector : IDisposable
1110
{
1211
public const string Keyword = "fltheme";
1312

14-
private readonly Settings _settings;
1513
private readonly Theme _theme;
1614
private readonly PluginInitContext _context;
1715

@@ -21,7 +19,6 @@ public ThemeSelector(PluginInitContext context)
2119
{
2220
_context = context;
2321
_theme = Ioc.Default.GetRequiredService<Theme>();
24-
_settings = Ioc.Default.GetRequiredService<Settings>();
2522
context.API.VisibilityChanged += OnVisibilityChanged;
2623
}
2724

@@ -69,7 +66,7 @@ private void LoadThemes()
6966
private Result CreateThemeResult(string theme, int score, IList<int> highlightData)
7067
{
7168
string title;
72-
if (theme == _settings.Theme)
69+
if (theme == _theme.CurrentTheme)
7370
{
7471
title = $"{theme} ★";
7572
score = 2000;

0 commit comments

Comments
 (0)