From adeb7d2c3598bf382f3fce50affdd9413434f037 Mon Sep 17 00:00:00 2001 From: Steffen Wilke Date: Tue, 11 Feb 2020 14:42:40 +0100 Subject: [PATCH] Optimize applying the theme - Don't re-apply the theme when opening the configuration or wizard. It's already applied at that time. - Apply the theme before first Showing the MainWindow. This fixes an issue with the default material theme being shown until the connectors are loaded. --- src/Soloplan.WhatsON.GUI/App.xaml.cs | 9 +++++++-- src/Soloplan.WhatsON.GUI/Configuration/AboutPage.xaml | 4 ++-- .../Configuration/View/ConfigWindow.xaml.cs | 1 - .../Configuration/Wizard/WizardWindow.xaml.cs | 2 -- src/Soloplan.WhatsON.GUI/TrayHandler.cs | 7 +------ 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/Soloplan.WhatsON.GUI/App.xaml.cs b/src/Soloplan.WhatsON.GUI/App.xaml.cs index a7fb7c3..a7eaace 100644 --- a/src/Soloplan.WhatsON.GUI/App.xaml.cs +++ b/src/Soloplan.WhatsON.GUI/App.xaml.cs @@ -70,8 +70,6 @@ public void ApplyTheme(bool? isDark = null) protected override void OnStartup(StartupEventArgs e) { - base.OnStartup(e); - var configDirArg = e.Args.FirstOrDefault(a => a.ToLower().StartsWith(ConfigDirArgName.ToLower())); if (configDirArg != null) { @@ -112,10 +110,17 @@ protected override void OnStartup(StartupEventArgs e) this.themeHelper.Initialize(this.handler.VisualSettings?.ColorSettings); this.ApplyTheme(); + if (!this.config.OpenMinimized) + { + this.handler.ShowOrHideWindow(); + } + Timeline.DesiredFrameRateProperty.OverrideMetadata(typeof(Timeline), new FrameworkPropertyMetadata { DefaultValue = 15 }); this.scheduler.Start(); ComponentDispatcher.ThreadPreprocessMessage += this.ComponentDispatcherThreadPreprocessMessage; + + base.OnStartup(e); } /// diff --git a/src/Soloplan.WhatsON.GUI/Configuration/AboutPage.xaml b/src/Soloplan.WhatsON.GUI/Configuration/AboutPage.xaml index d549b93..009f867 100644 --- a/src/Soloplan.WhatsON.GUI/Configuration/AboutPage.xaml +++ b/src/Soloplan.WhatsON.GUI/Configuration/AboutPage.xaml @@ -40,8 +40,8 @@ -