Remove Theme Suspend/Resume calls, only fire ReloadAll if not loading

This commit is contained in:
John Lewin 2017-06-21 07:29:22 -07:00
parent e9d7cefa85
commit d6d625245f
3 changed files with 11 additions and 16 deletions

View file

@ -303,7 +303,13 @@ namespace MatterHackers.MatterControl
this.Library.ContentProviders.Add(new[] { "stl", "amf", "mcx" }, new MeshContentProvider());
// Name = "MainSlidePanel";
ActiveTheme.ThemeChanged.RegisterEvent((s, e) => ReloadAll(), ref unregisterEvents);
ActiveTheme.ThemeChanged.RegisterEvent((s, e) =>
{
if (!MatterControlApplication.IsLoading)
{
ReloadAll();
}
}, ref unregisterEvents);
ActiveSliceSettings.MaterialPresetChanged += (s, e) =>
{
@ -537,8 +543,6 @@ namespace MatterHackers.MatterControl
static void LoadOemOrDefaultTheme()
{
ActiveTheme.SuspendEvents();
// if not check for the oem color and use it if set
// else default to "Blue - Light"
string oemColor = OemSettings.Instance.ThemeColor;
@ -550,8 +554,6 @@ namespace MatterHackers.MatterControl
{
ActiveTheme.Instance = ActiveTheme.GetThemeColors(oemColor);
}
ActiveTheme.ResumeEvents();
}
public static ApplicationController Instance