UI Slice 1a: Shell-Fundament + Launcher-Buttons statisch + Fenster-Menue + maximiert
- IModuleUiHost (Core) um Navigation erweitert: Views/IsOpen/OpenView/ActivateMain/OpenStateChanged + optionales Icon je ModuleView. So kann JEDES Fenster (auch Modul-Fenster, die nur Core kennen) das gemeinsame Fenster-Menue bauen. - WindowMenu (Core): baut das 'Fenster'-Dropdown (Launcher + alle Views + Beenden), haakt offene Fenster an, markiert das aktuelle fett; Neuaufbau beim Aufklappen. - ShellUiHost: SetMainWindow/ActivateMain; oeffnet ALLE Fenster jetzt MAXIMIERT (Vorgabe). - Launcher: alle Modul-/Core-Buttons STATISCH im Designer (btn_copytrading/-resolutionfarming/ -supervisor ergaenzt), an View-IDs gebunden; fehlt eine View -> Button deaktiviert. Dynamischer Laufzeit-Anhang ENTFERNT -> kein doppelter Accounting-Button mehr; leerer btn_accounting_Click raus. Datei/Beenden -> Fenster-Menue (WindowMenu). Launcher startet maximiert (Sizable, MinSize 1280x720). Build 0 Fehler, --smoke-ui alle 6 Views + Launcher gruen. Fenster-Menue auf den uebrigen Fenstern folgt (1b). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
ca0d4ceed0
commit
f54cd7423b
@@ -16,6 +16,7 @@ namespace PolyTraderSharp.Ui
|
||||
{
|
||||
private readonly List<ModuleView> _views = new();
|
||||
private readonly Dictionary<string, Form> _open = new();
|
||||
private Form? _mainWindow;
|
||||
|
||||
/// <summary>Wird ausgelöst, wenn sich der Offen-Status irgendeiner View ändert.</summary>
|
||||
public event Action? OpenStateChanged;
|
||||
@@ -24,6 +25,18 @@ namespace PolyTraderSharp.Ui
|
||||
|
||||
public void RegisterView(ModuleView view) => _views.Add(view);
|
||||
|
||||
/// <summary>Setzt das Hauptfenster (Launcher) – Ziel für <see cref="ActivateMain"/>.</summary>
|
||||
public void SetMainWindow(Form main) => _mainWindow = main;
|
||||
|
||||
public void ActivateMain()
|
||||
{
|
||||
if (_mainWindow == null || _mainWindow.IsDisposed) return;
|
||||
if (_mainWindow.WindowState == FormWindowState.Minimized)
|
||||
_mainWindow.WindowState = FormWindowState.Maximized;
|
||||
_mainWindow.BringToFront();
|
||||
_mainWindow.Activate();
|
||||
}
|
||||
|
||||
public bool IsOpen(string viewId) =>
|
||||
_open.TryGetValue(viewId, out var form) && !form.IsDisposed;
|
||||
|
||||
@@ -48,6 +61,10 @@ namespace PolyTraderSharp.Ui
|
||||
if (string.IsNullOrEmpty(form.Text) || form.Text == form.Name)
|
||||
form.Text = view.Title;
|
||||
|
||||
// Alle Fenster maximiert (Vorgabe): Full-HD-Ziel, skaliert auf größere Auflösungen.
|
||||
form.StartPosition = FormStartPosition.CenterScreen;
|
||||
form.WindowState = FormWindowState.Maximized;
|
||||
|
||||
_open[view.Id] = form;
|
||||
form.FormClosed += (_, _) =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user