From ca3fb843094401d341258a3d258759d2a6fad886 Mon Sep 17 00:00:00 2001 From: Tiberius Sicae Date: Thu, 4 Jun 2026 16:02:57 +0100 Subject: [PATCH] EDDI UI Rework --- CargoMonitor/ConfigurationWindow.xaml | 26 +- ChangeLog.md | 1 + CommanderMonitor/ConfigurationWindow.xaml | 12 +- ConfigService/ConfigService.cs | 6 +- .../Configurations/EDDIConfiguration.cs | 19 +- CrimeMonitor/ConfigurationWindow.xaml | 18 +- Directory.Build.targets | 6 +- EDDI/App.xaml | 8 +- EDDI/App.xaml.cs | 5 + EDDI/ThemeService.cs | 34 + EDDI/Themes/DarkTheme.xaml | 35 + EDDPMonitor/ConfigurationWindow.xaml | 8 +- EDSMResponder/ConfigurationWindow.xaml | 12 +- EddiCore/Hotkeys/HotkeysWindow.xaml | 6 +- EddiUI/ChangeLog.xaml.cs | 4 +- EddiUI/FrontierApiTab.xaml | 9 +- EddiUI/MainWindow.xaml | 71 +- EddiUI/MainWindow.xaml.cs | 65 +- EddiUI/PluginSkeleton.xaml | 8 +- EddiUI/Properties/Resources.Designer.cs | 56 +- EddiUI/Properties/Resources.resx | 21 +- EddiUI/RespondersTab.xaml | 19 + EddiUI/RespondersTab.xaml.cs | 58 ++ EddiUI/Themes/ThemeDark.xaml | 87 ++ EddiUI/Themes/ThemeLight.xaml | 87 ++ EddiUI/Themes/ThemeManager.cs | 175 ++++ EddiUI/Themes/ThemeModern.xaml | 942 ++++++++++++++++++ GalnetMonitor/ConfigurationWindow.xaml | 18 +- InaraResponder/ConfigurationWindow.xaml | 6 +- MODERNIZATION_PLAN.md | 537 ++++++++++ MaterialMonitor/ConfigurationWindow.xaml | 62 +- MissionMonitor/ConfigurationWindow.xaml | 30 +- NavigationMonitor/BookmarkSelector.xaml | 24 +- NavigationMonitor/BookmarksControl.xaml | 14 +- NavigationMonitor/BookmarksControl.xaml.cs | 4 +- NavigationMonitor/ConfigurationWindow.xaml | 8 +- NavigationMonitor/CurrentRouteControl.xaml | 14 +- NavigationMonitor/GalacticPOIControl.xaml | 12 +- NavigationMonitor/GalacticPOIControl.xaml.cs | 4 +- NavigationMonitor/PlotCarrierControl.xaml | 18 +- NavigationMonitor/PlotShipControl.xaml | 22 +- ShipMonitor/ConfigurationWindow.xaml | 66 +- .../AvalonEdit/CottleHighlighting.cs | 58 +- .../AvalonEdit/TextCompletionControl.xaml | 4 +- SpeechResponder/ConfigurationWindow.xaml | 24 +- SpeechResponder/CopyPersonalityWindow.xaml | 6 +- SpeechResponder/EditScriptWindow.xaml | 12 +- SpeechResponder/MarkdownWindow.xaml.cs | 4 +- SpeechResponder/ShowDiffWindow.xaml | 8 +- SpeechResponder/VariablesWindow.xaml.cs | 4 +- SpeechResponder/ViewScriptWindow.xaml | 8 +- UI_ChangeLog.md | 64 ++ UI_STYLING_ANALYSIS.md | 593 +++++++++++ Utilities/IpaResources.xaml | 12 +- Utilities/MarkdownDecorator.cs | 114 +++ VoiceAttackResponder/ConfigurationWindow.xaml | 12 +- build-installer.cmd | 6 +- postBuildTests.bat | 3 +- 58 files changed, 3242 insertions(+), 327 deletions(-) create mode 100644 EDDI/ThemeService.cs create mode 100644 EDDI/Themes/DarkTheme.xaml create mode 100644 EddiUI/RespondersTab.xaml create mode 100644 EddiUI/RespondersTab.xaml.cs create mode 100644 EddiUI/Themes/ThemeDark.xaml create mode 100644 EddiUI/Themes/ThemeLight.xaml create mode 100644 EddiUI/Themes/ThemeManager.cs create mode 100644 EddiUI/Themes/ThemeModern.xaml create mode 100644 MODERNIZATION_PLAN.md create mode 100644 UI_ChangeLog.md create mode 100644 UI_STYLING_ANALYSIS.md create mode 100644 Utilities/MarkdownDecorator.cs diff --git a/CargoMonitor/ConfigurationWindow.xaml b/CargoMonitor/ConfigurationWindow.xaml index 465ee0398a..9d1e6aa968 100644 --- a/CargoMonitor/ConfigurationWindow.xaml +++ b/CargoMonitor/ConfigurationWindow.xaml @@ -1,4 +1,4 @@ - - - - - + + + + + + - @@ -31,7 +33,7 @@ - @@ -44,7 +46,7 @@ - @@ -57,7 +59,7 @@ - @@ -70,7 +72,7 @@ - @@ -83,7 +85,7 @@ - @@ -96,7 +98,7 @@ - diff --git a/ChangeLog.md b/ChangeLog.md index d8afd59200..f1249949aa 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,6 +7,7 @@ Full details of the variables available for each noted event, and VoiceAttack in * Installer revised to more gracefully handle installation over an existing installation of EDDI 4.1.9 or earlier (e.g. when installing VoiceAttack 2 over an existing VoiceAttack 1 installation). * Various bug fixes from telemetry. * Speech Responder + * Fixed the active personality ComboBox layout in the Speech Responder tab so the dropdown arrow doesn't overlap the personality name text. * Fixed copied personalities not being editable until EDDI is restarted. * Fixed failing lexicon schema validation (for .pls lexicon files). (#2814) (thanks to @klightspeed) * Fix `StopSpeaking()` function from creating unexpected "paused" speech outputs when used in a script which enqueues new speech. (#2815) diff --git a/CommanderMonitor/ConfigurationWindow.xaml b/CommanderMonitor/ConfigurationWindow.xaml index d7537b977a..c3a1a43d4b 100644 --- a/CommanderMonitor/ConfigurationWindow.xaml +++ b/CommanderMonitor/ConfigurationWindow.xaml @@ -1,4 +1,4 @@ - - - + + @@ -36,8 +36,8 @@ - - + + @@ -71,7 +71,7 @@ - @@ -30,7 +30,7 @@ - @@ -43,7 +43,7 @@ - @@ -56,7 +56,7 @@ - @@ -69,7 +69,7 @@ - @@ -82,7 +82,7 @@ - diff --git a/Directory.Build.targets b/Directory.Build.targets index a663293550..cd7a7b603b 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,8 +1,8 @@ - + - + @@ -12,7 +12,7 @@ - + diff --git a/EDDI/App.xaml b/EDDI/App.xaml index 4924b2219d..983a6f0bef 100644 --- a/EDDI/App.xaml +++ b/EDDI/App.xaml @@ -1,6 +1,12 @@ - + + + + + + diff --git a/EDDI/App.xaml.cs b/EDDI/App.xaml.cs index f222aa250e..43aef2b4cd 100644 --- a/EDDI/App.xaml.cs +++ b/EDDI/App.xaml.cs @@ -60,6 +60,7 @@ public static void Main ( string[] args = null ) } var app = new App(); + app.InitializeComponent(); app.Exit += OnExit; try @@ -106,6 +107,9 @@ private static System.Version ParseVoiceAttackVersion( string[] args ) private static void Initialize ( App app, bool fromVA = false, System.Version vaVersion = null, EDDIConfiguration configuration = null ) { + // Initialize our dynamic theme management engine + EddiUI.Themes.ThemeManager.Initialize(); + // Prepare to start the application if ( configuration != null && !configuration.DisableTelemetry ) { @@ -187,6 +191,7 @@ private static void OnExit(object sender, ExitEventArgs e) // Always stop the EDDI instance so monitors and services are shut down // cleanly before the process exits. EDDI.Instance.Stop(); + ConfigService.Instance.Dispose(); Current?.Dispatcher?.InvokeAsync( () => { eddiMutex.ReleaseMutex(); diff --git a/EDDI/ThemeService.cs b/EDDI/ThemeService.cs new file mode 100644 index 0000000000..6dae024b6e --- /dev/null +++ b/EDDI/ThemeService.cs @@ -0,0 +1,34 @@ +using System; +using System.Linq; +using System.Windows; + +namespace Eddi +{ + public static class ThemeService + { + private static readonly Uri DarkThemeUri = new Uri("/EDDI;component/Themes/DarkTheme.xaml", UriKind.Relative); + + public static void ApplyTheme() + { + Application.Current.Dispatcher.Invoke(() => + { + var dictionaries = Application.Current.Resources.MergedDictionaries; + var existing = dictionaries.FirstOrDefault(d => d.Source != null && d.Source.OriginalString.Contains("DarkTheme.xaml")); + if (existing != null) + { + dictionaries.Remove(existing); + } + + try + { + var rd = new ResourceDictionary() { Source = DarkThemeUri }; + dictionaries.Add(rd); + } + catch (Exception) + { + // Swallow - fail safe to existing resources + } + }); + } + } +} diff --git a/EDDI/Themes/DarkTheme.xaml b/EDDI/Themes/DarkTheme.xaml new file mode 100644 index 0000000000..5063c10971 --- /dev/null +++ b/EDDI/Themes/DarkTheme.xaml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EDDPMonitor/ConfigurationWindow.xaml b/EDDPMonitor/ConfigurationWindow.xaml index 96b0ab8103..32ad2832bd 100644 --- a/EDDPMonitor/ConfigurationWindow.xaml +++ b/EDDPMonitor/ConfigurationWindow.xaml @@ -1,4 +1,4 @@ - - - - + + + + - - + + EDDI @@ -84,7 +57,7 @@ - + @@ -95,26 +68,32 @@ + - - - - - + - +