mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[PT Run] Option for override theme (#7355)
* option for override PT Run theme * fix startup theme detection and moved strings in resources * xaml fixed * fix title spacing * launcher theme fix moved theme enum removed settings direct access * missing files * theme manager dispose removed Co-authored-by: Clint Rutkas <clint@rutkas.com>
This commit is contained in:
committed by
GitHub
parent
6424667396
commit
146e7866a6
@@ -111,7 +111,7 @@ namespace PowerLauncher
|
||||
|
||||
RegisterExitEvents();
|
||||
|
||||
_settingsWatcher = new SettingsWatcher(_settings);
|
||||
_settingsWatcher = new SettingsWatcher(_settings, _themeManager);
|
||||
|
||||
_mainVM.MainWindowVisibility = Visibility.Visible;
|
||||
_mainVM.ColdStartFix();
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using ManagedCommon;
|
||||
using PowerLauncher.Helper;
|
||||
using PowerLauncher.ViewModel;
|
||||
using Wox.Core.Plugin;
|
||||
|
||||
@@ -6,6 +6,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Windows.Input;
|
||||
using ManagedCommon;
|
||||
using Microsoft.PowerToys.Settings.UI.Library;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Utilities;
|
||||
using PowerLauncher.Helper;
|
||||
@@ -27,11 +28,13 @@ namespace PowerLauncher
|
||||
private static readonly object _watcherSyncObject = new object();
|
||||
private readonly FileSystemWatcher _watcher;
|
||||
private readonly Settings _settings;
|
||||
private readonly ThemeManager _themeManager;
|
||||
|
||||
public SettingsWatcher(Settings settings)
|
||||
public SettingsWatcher(Settings settings, ThemeManager themeManager)
|
||||
{
|
||||
_settingsUtils = new SettingsUtils(new SystemIOProvider());
|
||||
_settings = settings;
|
||||
_themeManager = themeManager;
|
||||
|
||||
// Set up watcher
|
||||
_watcher = Microsoft.PowerToys.Settings.UI.Library.Utilities.Helper.GetFileWatcher(PowerLauncherSettings.ModuleName, "settings.json", OverloadSettings);
|
||||
@@ -100,6 +103,12 @@ namespace PowerLauncher
|
||||
_settings.ClearInputOnLaunch = overloadSettings.Properties.ClearInputOnLaunch;
|
||||
}
|
||||
|
||||
if (_settings.Theme != overloadSettings.Properties.Theme)
|
||||
{
|
||||
_settings.Theme = overloadSettings.Properties.Theme;
|
||||
_themeManager.ChangeTheme(_settings.Theme, _settings.Theme == Theme.System);
|
||||
}
|
||||
|
||||
retry = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user