mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
Merged from Navigation branch: ImGuiItemFlags_SelectableDontClosePopup flag
This commit is contained in:
parent
f99348711b
commit
926c1cf9a4
@ -8813,7 +8813,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
|
|||||||
if (flags & ImGuiSelectableFlags_Disabled) PopStyleColor();
|
if (flags & ImGuiSelectableFlags_Disabled) PopStyleColor();
|
||||||
|
|
||||||
// Automatically close popups
|
// Automatically close popups
|
||||||
if (pressed && !(flags & ImGuiSelectableFlags_DontClosePopups) && (window->Flags & ImGuiWindowFlags_Popup))
|
if (pressed && (window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiSelectableFlags_DontClosePopups) && !(window->DC.ItemFlags & ImGuiItemFlags_SelectableDontClosePopup))
|
||||||
CloseCurrentPopup();
|
CloseCurrentPopup();
|
||||||
return pressed;
|
return pressed;
|
||||||
}
|
}
|
||||||
|
@ -580,7 +580,7 @@ enum ImGuiItemFlags_
|
|||||||
ImGuiItemFlags_ButtonRepeat = 1 << 1, // false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings.
|
ImGuiItemFlags_ButtonRepeat = 1 << 1, // false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings.
|
||||||
//ImGuiItemFlags_Disabled = 1 << 2, // false // All widgets appears are disabled
|
//ImGuiItemFlags_Disabled = 1 << 2, // false // All widgets appears are disabled
|
||||||
//ImGuiItemFlags_AllowNavDefaultFocus = 1 << 3, // true
|
//ImGuiItemFlags_AllowNavDefaultFocus = 1 << 3, // true
|
||||||
//ImGuiItemFlags_SelectableDontClosePopup = 1 << 4, // false // MenuItem/Selectable() automatically closes current Popup window
|
ImGuiItemFlags_SelectableDontClosePopup = 1 << 4, // false // MenuItem/Selectable() automatically closes current Popup window
|
||||||
ImGuiItemFlags_Default_ = ImGuiItemFlags_AllowKeyboardFocus
|
ImGuiItemFlags_Default_ = ImGuiItemFlags_AllowKeyboardFocus
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user