From 761bc941a88d178ff75796db0ac0735f3960bd44 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 1 May 2024 20:50:35 +0200 Subject: [PATCH] impr: Make right click menus open faster --- plugins/builtin/source/content/ui_items.cpp | 2 +- plugins/builtin/source/content/views/view_data_processor.cpp | 2 +- plugins/builtin/source/content/views/view_hex_editor.cpp | 2 +- plugins/windows/source/views/view_tty_console.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/builtin/source/content/ui_items.cpp b/plugins/builtin/source/content/ui_items.cpp index 7946c7994..918604b07 100644 --- a/plugins/builtin/source/content/ui_items.cpp +++ b/plugins/builtin/source/content/ui_items.cpp @@ -502,7 +502,7 @@ namespace hex::plugin::builtin { break; } - if (ImGui::IsMouseReleased(ImGuiMouseButton_Right) && ImGui::IsItemHovered()) { + if (ImGui::IsMouseDown(ImGuiMouseButton_Right) && ImGui::IsItemHovered()) { rightClickedProvider = tabProvider; RequestOpenPopup::post("ProviderMenu"); } diff --git a/plugins/builtin/source/content/views/view_data_processor.cpp b/plugins/builtin/source/content/views/view_data_processor.cpp index 2a2891d18..29eb8ea75 100644 --- a/plugins/builtin/source/content/views/view_data_processor.cpp +++ b/plugins/builtin/source/content/views/view_data_processor.cpp @@ -590,7 +590,7 @@ namespace hex::plugin::builtin { void ViewDataProcessor::drawContextMenus(ViewDataProcessor::Workspace &workspace) { // Handle the right click context menus - if (ImGui::IsMouseClicked(ImGuiMouseButton_Right, true) && ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows)) { + if (ImGui::IsMouseDown(ImGuiMouseButton_Right) && ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows)) { // Clear selections ImNodes::ClearNodeSelection(); ImNodes::ClearLinkSelection(); diff --git a/plugins/builtin/source/content/views/view_hex_editor.cpp b/plugins/builtin/source/content/views/view_hex_editor.cpp index c1fdce62c..6394e6c6e 100644 --- a/plugins/builtin/source/content/views/view_hex_editor.cpp +++ b/plugins/builtin/source/content/views/view_hex_editor.cpp @@ -531,7 +531,7 @@ namespace hex::plugin::builtin { } // Right click menu - if (ImGui::IsMouseReleased(ImGuiMouseButton_Right) && ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows) && !ImGui::IsAnyItemHovered()) + if (ImGui::IsMouseDown(ImGuiMouseButton_Right) && ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows) && !ImGui::IsAnyItemHovered()) RequestOpenPopup::post("hex.builtin.menu.edit"); } diff --git a/plugins/windows/source/views/view_tty_console.cpp b/plugins/windows/source/views/view_tty_console.cpp index bbcbb8fc2..f14d0fd5d 100644 --- a/plugins/windows/source/views/view_tty_console.cpp +++ b/plugins/windows/source/views/view_tty_console.cpp @@ -146,7 +146,7 @@ namespace hex::plugin::windows { } ImGui::PopItemWidth(); - if (ImGui::IsMouseReleased(ImGuiMouseButton_Right) && ImGui::IsItemHovered() && m_portHandle != INVALID_HANDLE_VALUE && !m_transmitting) + if (ImGui::IsMouseDown(ImGuiMouseButton_Right) && ImGui::IsItemHovered() && m_portHandle != INVALID_HANDLE_VALUE && !m_transmitting) ImGui::OpenPopup("ConsoleMenu"); if (ImGui::BeginPopup("ConsoleMenu")) {