mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 13:35:31 +02:00
Completely rewrite resource load / update / remove
1. part of #468 2. fix #1245, bug introduced in 7e1c77beddf2c978fa1440e799fec4eb9554739d
This commit is contained in:
@@ -4,8 +4,10 @@ using System.Timers;
|
||||
using System.Windows;
|
||||
using Wox.Core;
|
||||
using Wox.Core.Plugin;
|
||||
using Wox.Core.Resource;
|
||||
using Wox.Helper;
|
||||
using Wox.Infrastructure;
|
||||
using Wox.Infrastructure.Http;
|
||||
using Wox.Infrastructure.Image;
|
||||
using Wox.Infrastructure.Logger;
|
||||
using Wox.Infrastructure.UserSettings;
|
||||
@@ -58,6 +60,18 @@ namespace Wox
|
||||
Current.MainWindow = window;
|
||||
Current.MainWindow.Title = Constant.Wox;
|
||||
|
||||
// happlebao todo temp fix for instance code logic
|
||||
// remove all dictionaries defined in xaml e.g.g App.xaml
|
||||
Current.Resources.MergedDictionaries.Clear();
|
||||
// load plugin before change language, because plugin language also needs be changed
|
||||
InternationalizationManager.Instance.Settings = _settings;
|
||||
InternationalizationManager.Instance.ChangeLanguage(_settings.Language);
|
||||
// main windows needs initialized before theme change because of blur settigns
|
||||
ThemeManager.Instance.Settings = _settings;
|
||||
ThemeManager.Instance.ChangeTheme(_settings.Theme);
|
||||
|
||||
Http.Proxy = _settings.Proxy;
|
||||
|
||||
RegisterExitEvents();
|
||||
|
||||
AutoStartup();
|
||||
@@ -68,6 +82,7 @@ namespace Wox
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void AutoStartup()
|
||||
{
|
||||
if (_settings.StartWoxOnSystemStartup)
|
||||
|
||||
@@ -60,8 +60,9 @@ namespace Wox
|
||||
|
||||
private void OnLoaded(object sender, RoutedEventArgs _)
|
||||
{
|
||||
// todo is there a way to set blur only once?
|
||||
ThemeManager.Instance.SetBlurForWindow();
|
||||
WindowsInteropHelper.DisableControlBox(this);
|
||||
ThemeManager.Instance.ChangeTheme(_settings.Theme);
|
||||
InitProgressbarAnimation();
|
||||
|
||||
_viewModel.PropertyChanged += (o, e) =>
|
||||
|
||||
@@ -33,11 +33,7 @@ namespace Wox.ViewModel
|
||||
}
|
||||
};
|
||||
|
||||
// happlebao todo temp fix for instance code logic
|
||||
InternationalizationManager.Instance.Settings = Settings;
|
||||
InternationalizationManager.Instance.ChangeLanguage(Settings.Language);
|
||||
ThemeManager.Instance.Settings = Settings;
|
||||
Http.Proxy = Settings.Proxy;
|
||||
|
||||
}
|
||||
|
||||
public Settings Settings { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user