mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Added most basic form of Disabled flag to disable interactions (but visuals aren't altered), in imgui_internals.h, undocumented/unsupported (#211, #1012)
This commit is contained in:
@ -2051,6 +2051,8 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
|
||||
return false;
|
||||
if (!IsWindowContentHoverable(window, flags))
|
||||
return false;
|
||||
if (window->DC.ItemFlags & ImGuiItemFlags_Disabled)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2070,6 +2072,8 @@ bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id)
|
||||
return false;
|
||||
if (!IsWindowContentHoverable(window, ImGuiHoveredFlags_Default))
|
||||
return false;
|
||||
if (window->DC.ItemFlags & ImGuiItemFlags_Disabled)
|
||||
return false;
|
||||
|
||||
SetHoveredID(id);
|
||||
return true;
|
||||
@ -2090,7 +2094,7 @@ bool ImGui::FocusableItemRegister(ImGuiWindow* window, ImGuiID id, bool tab_stop
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
|
||||
const bool allow_keyboard_focus = (window->DC.ItemFlags & ImGuiItemFlags_AllowKeyboardFocus) != 0;
|
||||
const bool allow_keyboard_focus = (window->DC.ItemFlags & (ImGuiItemFlags_AllowKeyboardFocus | ImGuiItemFlags_Disabled)) == ImGuiItemFlags_AllowKeyboardFocus;
|
||||
window->FocusIdxAllCounter++;
|
||||
if (allow_keyboard_focus)
|
||||
window->FocusIdxTabCounter++;
|
||||
|
Reference in New Issue
Block a user