diff --git a/lib/external/pattern_language b/lib/external/pattern_language index f0a68249e..456dd11fc 160000 --- a/lib/external/pattern_language +++ b/lib/external/pattern_language @@ -1 +1 @@ -Subproject commit f0a68249e71f6a3f38fdba292c4a2c9e9bab3ad2 +Subproject commit 456dd11fc74b12630c1c7679862cb665e741c4d0 diff --git a/lib/libimhex/source/api/task.cpp b/lib/libimhex/source/api/task.cpp index ab2684535..ffba65c31 100644 --- a/lib/libimhex/source/api/task.cpp +++ b/lib/libimhex/source/api/task.cpp @@ -174,7 +174,11 @@ namespace hex { void TaskManager::init() { - for (u32 i = 0; i < std::thread::hardware_concurrency(); i++) + const auto threadCount = std::thread::hardware_concurrency(); + + log::debug("Initializing task manager thread pool with {} workers.", threadCount); + + for (u32 i = 0; i < threadCount; i++) TaskManager::s_workers.emplace_back(TaskManager::runner); } @@ -207,6 +211,7 @@ namespace hex { try { task->m_function(*task); + log::debug("Finished task {}", task->m_unlocalizedName); } catch (const Task::TaskInterruptor &) { task->interruption(); } catch (const std::exception &e) { @@ -222,6 +227,7 @@ namespace hex { } TaskHolder TaskManager::createTask(std::string name, u64 maxValue, std::function function) { + log::debug("Creating task {}", name); std::unique_lock lock(s_queueMutex); auto task = std::make_shared(std::move(name), maxValue, false, std::move(function)); s_tasks.emplace_back(task); @@ -233,6 +239,7 @@ namespace hex { } TaskHolder TaskManager::createBackgroundTask(std::string name, std::function function) { + log::debug("Creating background task {}", name); std::unique_lock lock(s_queueMutex); auto task = std::make_shared(std::move(name), 0, true, std::move(function)); diff --git a/main/source/init/tasks.cpp b/main/source/init/tasks.cpp index b99f1f698..594813baa 100644 --- a/main/source/init/tasks.cpp +++ b/main/source/init/tasks.cpp @@ -518,7 +518,7 @@ namespace hex::init { { "Saving settings...", storeSettings, false }, { "Cleaning up shared data...", deleteSharedData, false }, { "Unloading plugins...", unloadPlugins, false }, - { "Clearing old logs...", clearOldLogs, false }, + { "Clearing old logs...", clearOldLogs, false }, }; } diff --git a/main/source/main.cpp b/main/source/main.cpp index 111657360..9f3b06ca1 100644 --- a/main/source/main.cpp +++ b/main/source/main.cpp @@ -7,7 +7,6 @@ #include "init/splash_window.hpp" #include "init/tasks.hpp" -#include "init/tasks.hpp" #include #include diff --git a/plugins/builtin/source/ui/pattern_drawer.cpp b/plugins/builtin/source/ui/pattern_drawer.cpp index 280fd81c6..0e6f6e481 100644 --- a/plugins/builtin/source/ui/pattern_drawer.cpp +++ b/plugins/builtin/source/ui/pattern_drawer.cpp @@ -83,20 +83,6 @@ namespace hex::plugin::builtin::ui { ImGui::TableNextColumn(); } - void drawNameColumn(const pl::ptrn::Pattern& pattern) { - highlightWhenSelected(pattern, [&]{ - auto name = pattern.getDisplayName(); - - ImGui::TextFormatted("{}", name); - - if (ImGui::CalcTextSize(name.c_str()).x > ImGui::GetColumnWidth()) { - ImGui::InfoTooltip(name.c_str()); - } - - }); - ImGui::TableNextColumn(); - } - void drawColorColumn(const pl::ptrn::Pattern& pattern) { if (pattern.getVisibility() == pl::ptrn::Visibility::Visible) ImGui::ColorButton("color", ImColor(pattern.getColor()), ImGuiColorEditFlags_NoTooltip, ImVec2(ImGui::GetColumnWidth(), ImGui::GetTextLineHeight())); @@ -364,12 +350,12 @@ namespace hex::plugin::builtin::ui { void PatternDrawer::visit(pl::ptrn::PatternBitfieldField& pattern) { ImGui::TableNextRow(); - createTreeNode(pattern, true); ImGui::TableNextColumn(); + createTreeNode(pattern, true); + ImGui::SameLine(0, 0); makeSelectable(pattern); drawCommentTooltip(pattern); - ImGui::SameLine(); - drawNameColumn(pattern); + ImGui::TableNextColumn(); drawColorColumn(pattern); drawOffsetColumnForBitfieldMember(pattern); ImGui::TableNextColumn(); @@ -502,12 +488,12 @@ namespace hex::plugin::builtin::ui { void PatternDrawer::visit(pl::ptrn::PatternEnum& pattern) { ImGui::TableNextRow(); + ImGui::TableNextColumn(); createTreeNode(pattern, true); + ImGui::SameLine(0, 0); + makeSelectable(pattern); drawCommentTooltip(pattern); ImGui::TableNextColumn(); - makeSelectable(pattern); - ImGui::SameLine(); - drawNameColumn(pattern); drawColorColumn(pattern); drawOffsetColumn(pattern); drawSizeColumn(pattern); @@ -834,6 +820,7 @@ namespace hex::plugin::builtin::ui { if (chunkCount > displayEnd) { ImGui::TableNextRow(); ImGui::TableNextColumn(); + ImGui::TableNextColumn(); ImGui::Selectable(hex::format("... ({})", "hex.builtin.pattern_drawer.double_click"_lang).c_str(), false, ImGuiSelectableFlags_SpanAllColumns); if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left))