diff --git a/plugins/builtin/include/content/views/view_information.hpp b/plugins/builtin/include/content/views/view_information.hpp index a1ce189ff..6dee65e8d 100644 --- a/plugins/builtin/include/content/views/view_information.hpp +++ b/plugins/builtin/include/content/views/view_information.hpp @@ -30,6 +30,7 @@ namespace hex::plugin::builtin { }; PerProvider m_analysisData; + PerProvider m_settingsCollapsed; }; } diff --git a/plugins/builtin/source/content/views/view_information.cpp b/plugins/builtin/source/content/views/view_information.cpp index efa5fc746..19b4ad942 100644 --- a/plugins/builtin/source/content/views/view_information.cpp +++ b/plugins/builtin/source/content/views/view_information.cpp @@ -67,7 +67,7 @@ namespace hex::plugin::builtin { } // Run analyzers for each section - analysis.task = TaskManager::createTask("hex.builtin.view.information.analyzing", analysis.informationSections.size(), [provider, &analysis](Task &task) { + analysis.task = TaskManager::createTask("hex.builtin.view.information.analyzing", analysis.informationSections.size(), [this, provider, &analysis](Task &task) { u32 progress = 0; for (const auto §ion : analysis.informationSections) { // Only process the section if it is enabled @@ -92,6 +92,8 @@ namespace hex::plugin::builtin { progress += 1; task.update(progress); } + + m_settingsCollapsed.get(provider) = true; }); } @@ -104,7 +106,7 @@ namespace hex::plugin::builtin { // Draw settings window ImGui::BeginDisabled(analysis.task.isRunning()); - if (ImGuiExt::BeginSubWindow("hex.ui.common.settings"_lang)) { + if (ImGuiExt::BeginSubWindow("hex.ui.common.settings"_lang, &m_settingsCollapsed.get(provider), m_settingsCollapsed.get(provider) ? ImVec2(0, 1) : ImVec2(0, 0))) { // Create a table so we can draw global settings on the left and section specific settings on the right if (ImGui::BeginTable("SettingsTable", 2, ImGuiTableFlags_BordersInner | ImGuiTableFlags_SizingStretchProp, ImVec2(ImGui::GetContentRegionAvail().x, 0))) { ImGui::TableSetupColumn("Left", ImGuiTableColumnFlags_WidthStretch, 0.3F); @@ -153,6 +155,8 @@ namespace hex::plugin::builtin { ImGuiExt::EndSubWindow(); ImGui::EndDisabled(); + ImGui::NewLine(); + if (analysis.analyzedProvider != nullptr) { for (const auto §ion : analysis.informationSections) { ImGui::TableNextColumn(); @@ -217,8 +221,11 @@ namespace hex::plugin::builtin { section->drawContent(); else if (section->isAnalyzing()) ImGuiExt::TextSpinner("hex.builtin.view.information.analyzing"_lang); - else + else { + ImGui::BeginDisabled(); ImGuiExt::TextFormattedCenteredHorizontal("hex.builtin.view.information.not_analyzed"_lang); + ImGui::EndDisabled(); + } } ImGui::EndDisabled(); } @@ -226,8 +233,6 @@ namespace hex::plugin::builtin { ImGui::PopStyleVar(); ImGui::PopID(); - - ImGui::NewLine(); } } }