mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
MultiSelect: Fixed right-click handling in MultiSelectItemFooter() when not focused.
This commit is contained in:
parent
e3616e151f
commit
ab9326f4ae
1 changed files with 5 additions and 2 deletions
|
|
@ -7332,7 +7332,11 @@ void ImGui::MultiSelectItemFooter(ImGuiID id, bool* p_selected, bool* p_pressed)
|
||||||
ImGuiMultiSelectState* storage = ms->Storage;
|
ImGuiMultiSelectState* storage = ms->Storage;
|
||||||
if (pressed)
|
if (pressed)
|
||||||
ms->IsFocused = true;
|
ms->IsFocused = true;
|
||||||
if (!ms->IsFocused)
|
|
||||||
|
bool hovered = false;
|
||||||
|
if (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HoveredRect)
|
||||||
|
hovered = IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup);
|
||||||
|
if (!ms->IsFocused && !hovered)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
void* item_data = (void*)g.NextItemData.SelectionUserData;
|
void* item_data = (void*)g.NextItemData.SelectionUserData;
|
||||||
|
|
@ -7358,7 +7362,6 @@ void ImGui::MultiSelectItemFooter(ImGuiID id, bool* p_selected, bool* p_pressed)
|
||||||
|
|
||||||
// Right-click handling: this could be moved at the Selectable() level.
|
// Right-click handling: this could be moved at the Selectable() level.
|
||||||
// FIXME-MULTISELECT: See https://github.com/ocornut/imgui/pull/5816
|
// FIXME-MULTISELECT: See https://github.com/ocornut/imgui/pull/5816
|
||||||
bool hovered = IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup);
|
|
||||||
if (hovered && IsMouseClicked(1))
|
if (hovered && IsMouseClicked(1))
|
||||||
{
|
{
|
||||||
if (g.ActiveId != 0 && g.ActiveId != id)
|
if (g.ActiveId != 0 && g.ActiveId != id)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue