From 43f1cc7bd0e032620de77180d7a2c83564b1b4b5 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 14 Nov 2023 16:50:38 +0100 Subject: [PATCH] fix: Highlight color of bookmark not changing with bookmark --- plugins/builtin/source/content/views/view_bookmarks.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/builtin/source/content/views/view_bookmarks.cpp b/plugins/builtin/source/content/views/view_bookmarks.cpp index d21298664..9df03f04c 100644 --- a/plugins/builtin/source/content/views/view_bookmarks.cpp +++ b/plugins/builtin/source/content/views/view_bookmarks.cpp @@ -171,8 +171,11 @@ namespace hex::plugin::builtin { return result; }(); + bool colorChanged = false; + // Draw default color picker - ImGui::ColorPicker4("##picker", (float*)&color, ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_NoSmallPreview); + if (ImGui::ColorPicker4("##picker", (float*)&color, ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_NoSmallPreview)) + colorChanged = true; ImGui::Separator(); @@ -186,11 +189,15 @@ namespace hex::plugin::builtin { constexpr static ImGuiColorEditFlags flags = ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_NoDragDrop; if (ImGui::ColorButton("##palette", paletteColor.Value, flags, ImVec2(20, 20))) { color = paletteColor; + colorChanged = true; } ImGui::PopID(); id++; } + + if (colorChanged) + EventManager::post(); } void ViewBookmarks::drawContent() {