refactor(editor): enhance UI coordination and menu management
- Updated EditorManager to include ShortcutManager in the UICoordinator initialization, improving UI responsiveness. - Refactored menu handling in MenuOrchestrator to delegate more responsibilities to UICoordinator, streamlining the UI flow. - Removed unused menu items and comments, clarifying the code structure and enhancing maintainability. Benefits: - Improves the organization of UI components, leading to a more efficient user experience. - Enhances clarity in the codebase by reducing clutter and focusing on essential functionalities.
This commit is contained in:
@@ -31,7 +31,8 @@ UICoordinator::UICoordinator(
|
||||
SessionCoordinator& session_coordinator,
|
||||
WindowDelegate& window_delegate,
|
||||
ToastManager& toast_manager,
|
||||
PopupManager& popup_manager)
|
||||
PopupManager& popup_manager,
|
||||
ShortcutManager& shortcut_manager)
|
||||
: editor_manager_(editor_manager),
|
||||
rom_manager_(rom_manager),
|
||||
project_manager_(project_manager),
|
||||
@@ -39,7 +40,8 @@ UICoordinator::UICoordinator(
|
||||
session_coordinator_(session_coordinator),
|
||||
window_delegate_(window_delegate),
|
||||
toast_manager_(toast_manager),
|
||||
popup_manager_(popup_manager) {
|
||||
popup_manager_(popup_manager),
|
||||
shortcut_manager_(shortcut_manager) {
|
||||
|
||||
// Initialize welcome screen with proper callbacks
|
||||
welcome_screen_ = std::make_unique<WelcomeScreen>();
|
||||
@@ -92,8 +94,7 @@ UICoordinator::UICoordinator(
|
||||
}
|
||||
|
||||
void UICoordinator::DrawAllUI() {
|
||||
// Apply Material Design styling
|
||||
ApplyMaterialDesignStyling();
|
||||
// Note: Theme styling is applied by ThemeManager, not here
|
||||
|
||||
// Draw all UI components in order
|
||||
DrawMenuBarExtras();
|
||||
|
||||
@@ -21,6 +21,7 @@ class EditorRegistry;
|
||||
class SessionCoordinator;
|
||||
class ToastManager;
|
||||
class WindowDelegate;
|
||||
class ShortcutManager;
|
||||
|
||||
/**
|
||||
* @class UICoordinator
|
||||
@@ -47,7 +48,8 @@ class UICoordinator {
|
||||
SessionCoordinator& session_coordinator,
|
||||
WindowDelegate& window_delegate,
|
||||
ToastManager& toast_manager,
|
||||
PopupManager& popup_manager);
|
||||
PopupManager& popup_manager,
|
||||
ShortcutManager& shortcut_manager);
|
||||
~UICoordinator() = default;
|
||||
|
||||
// Non-copyable due to reference members
|
||||
@@ -59,6 +61,10 @@ class UICoordinator {
|
||||
void DrawMenuBarExtras();
|
||||
void DrawContextSensitiveCardControl();
|
||||
|
||||
// Core UI components (actual ImGui rendering moved from EditorManager)
|
||||
void DrawCommandPalette();
|
||||
void DrawGlobalSearch();
|
||||
|
||||
// Session UI components
|
||||
void DrawSessionSwitcher();
|
||||
void DrawSessionManager();
|
||||
@@ -117,10 +123,7 @@ class UICoordinator {
|
||||
void SetImGuiDemoVisible(bool visible) { show_imgui_demo_ = visible; }
|
||||
void SetImGuiMetricsVisible(bool visible) { show_imgui_metrics_ = visible; }
|
||||
|
||||
// Theme and styling helpers
|
||||
void ApplyMaterialDesignStyling();
|
||||
void UpdateThemeElements();
|
||||
void DrawThemePreview();
|
||||
// Note: Theme styling is handled by ThemeManager, not UICoordinator
|
||||
|
||||
private:
|
||||
// References to coordinated managers
|
||||
@@ -132,6 +135,7 @@ class UICoordinator {
|
||||
WindowDelegate& window_delegate_;
|
||||
ToastManager& toast_manager_;
|
||||
PopupManager& popup_manager_;
|
||||
ShortcutManager& shortcut_manager_;
|
||||
|
||||
// UI state flags (UICoordinator owns all UI visibility state)
|
||||
bool show_editor_selection_ = false;
|
||||
|
||||
Reference in New Issue
Block a user