refactor(editor): improve visibility management for card-based editors
- Updated EditorManager to pass visibility flags directly to memory and assembly editors, enhancing the responsiveness of the editor interface. - Simplified visibility checks by retrieving flags from the EditorCardManager, ensuring accurate updates based on user interactions. Benefits: - Streamlines the editor update process, improving user experience by ensuring editors reflect their visibility state accurately.
This commit is contained in:
@@ -1568,15 +1568,19 @@ void EditorManager::DrawMenuBar() {
|
||||
ShowMetricsWindow(&show_imgui_metrics_);
|
||||
|
||||
auto& card_manager = gui::EditorCardManager::Get();
|
||||
if (card_manager.IsCardVisible("memory.hex_editor") && current_editor_set_) {
|
||||
bool show_memory = true;
|
||||
current_editor_set_->memory_editor_.Update(show_memory);
|
||||
if (current_editor_set_) {
|
||||
// Pass the actual visibility flag pointer so the X button works
|
||||
bool* hex_visibility = card_manager.GetVisibilityFlag("memory.hex_editor");
|
||||
if (hex_visibility && *hex_visibility) {
|
||||
current_editor_set_->memory_editor_.Update(*hex_visibility);
|
||||
}
|
||||
|
||||
bool* assembly_visibility = card_manager.GetVisibilityFlag("assembly.editor");
|
||||
if (assembly_visibility && *assembly_visibility) {
|
||||
current_editor_set_->assembly_editor_.Update(*card_manager.GetVisibilityFlag("assembly.editor"));
|
||||
}
|
||||
}
|
||||
if (card_manager.IsCardVisible("assembly.editor") && current_editor_set_) {
|
||||
bool show_asm = true;
|
||||
current_editor_set_->assembly_editor_.Update(show_asm);
|
||||
}
|
||||
|
||||
|
||||
// Project file editor
|
||||
project_file_editor_.Draw();
|
||||
if (show_performance_dashboard_) {
|
||||
|
||||
Reference in New Issue
Block a user