Skip to content

Commit 761bc94

Browse files
committed
impr: Make right click menus open faster
1 parent aa5a3ed commit 761bc94

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

plugins/builtin/source/content/ui_items.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ namespace hex::plugin::builtin {
502502
break;
503503
}
504504

505-
if (ImGui::IsMouseReleased(ImGuiMouseButton_Right) && ImGui::IsItemHovered()) {
505+
if (ImGui::IsMouseDown(ImGuiMouseButton_Right) && ImGui::IsItemHovered()) {
506506
rightClickedProvider = tabProvider;
507507
RequestOpenPopup::post("ProviderMenu");
508508
}

plugins/builtin/source/content/views/view_data_processor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ namespace hex::plugin::builtin {
590590

591591
void ViewDataProcessor::drawContextMenus(ViewDataProcessor::Workspace &workspace) {
592592
// Handle the right click context menus
593-
if (ImGui::IsMouseClicked(ImGuiMouseButton_Right, true) && ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows)) {
593+
if (ImGui::IsMouseDown(ImGuiMouseButton_Right) && ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows)) {
594594
// Clear selections
595595
ImNodes::ClearNodeSelection();
596596
ImNodes::ClearLinkSelection();

plugins/builtin/source/content/views/view_hex_editor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ namespace hex::plugin::builtin {
531531
}
532532

533533
// Right click menu
534-
if (ImGui::IsMouseReleased(ImGuiMouseButton_Right) && ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows) && !ImGui::IsAnyItemHovered())
534+
if (ImGui::IsMouseDown(ImGuiMouseButton_Right) && ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows) && !ImGui::IsAnyItemHovered())
535535
RequestOpenPopup::post("hex.builtin.menu.edit");
536536
}
537537

plugins/windows/source/views/view_tty_console.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ namespace hex::plugin::windows {
146146
}
147147
ImGui::PopItemWidth();
148148

149-
if (ImGui::IsMouseReleased(ImGuiMouseButton_Right) && ImGui::IsItemHovered() && m_portHandle != INVALID_HANDLE_VALUE && !m_transmitting)
149+
if (ImGui::IsMouseDown(ImGuiMouseButton_Right) && ImGui::IsItemHovered() && m_portHandle != INVALID_HANDLE_VALUE && !m_transmitting)
150150
ImGui::OpenPopup("ConsoleMenu");
151151

152152
if (ImGui::BeginPopup("ConsoleMenu")) {

0 commit comments

Comments
 (0)