Launcher: ToolStrip-Fensterleiste + Icons (aus PolytraderSharp)

- Fenster-Buttons in einem ToolStrip (Icon ueber Text, 32x32) statt Einzel-Buttons
- 24 Icon-PNGs aus PolytraderSharp uebernommen (Resources/) + Properties/Resources.resx
  (ResXFileRef) + Resources.Designer.cs
- Program.AssignViewIcons: Icons je View-ID zugewiesen (Workers=system_time, Logs=error_log,
  Settings=setting_tools, CongressTrading=cross_reference); Icons auch im Fenster-Menue
- Button-Checked spiegelt Offen-Status
- Build + 30/30 Tests + smoke-ui gruen; Screenshot geprueft

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@
This commit is contained in:
Richard
2026-07-28 10:25:14 +02:00
parent 8f44c0fd82
commit 218247b5f6
29 changed files with 499 additions and 13 deletions
+20
View File
@@ -63,6 +63,7 @@ internal static class Program
RegisterCoreViews(uiHost, AppHost.Services);
foreach (var module in modules)
module.RegisterUi(uiHost, AppHost.Services);
AssignViewIcons(uiHost);
Application.Run(AppHost.Services.GetRequiredService<LauncherForm>());
AppHost.StopAsync().GetAwaiter().GetResult();
@@ -113,6 +114,25 @@ internal static class Program
services.AddSingleton<WorkerEngine>();
}
/// <summary>
/// Weist den registrierten Views ihr Button-/Menü-Icon aus den App-Ressourcen zu (über die stabile
/// View-ID). Icons stammen aus PolytraderSharp; nicht passende können später ausgetauscht werden.
/// Bereits gesetzte Icons bleiben erhalten.
/// </summary>
private static void AssignViewIcons(IModuleUiHost uiHost)
{
var map = new Dictionary<string, Image>
{
["core.workers"] = Properties.Resources.system_time,
["core.logs"] = Properties.Resources.error_log,
["core.settings"] = Properties.Resources.setting_tools,
["congresstrading.main"] = Properties.Resources.cross_reference,
};
foreach (var view in uiHost.Views)
if (view.Icon is null && map.TryGetValue(view.Id, out var img))
view.Icon = img;
}
/// <summary>Registriert die Core-Views (Logs, Settings, Workers) bei der Shell.</summary>
private static void RegisterCoreViews(IModuleUiHost uiHost, IServiceProvider sp)
{