mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-20 01:34:20 +00:00
Added IsRootWindowOrAnyChildHovered() helper (#615)
This commit is contained in:
parent
60d6c6d0e8
commit
befe02559a
2 changed files with 10 additions and 5 deletions
12
imgui.cpp
12
imgui.cpp
|
|
@ -4579,15 +4579,19 @@ bool ImGui::IsWindowFocused()
|
|||
bool ImGui::IsRootWindowFocused()
|
||||
{
|
||||
ImGuiState& g = *GImGui;
|
||||
ImGuiWindow* root_window = g.CurrentWindow->RootWindow;
|
||||
return g.FocusedWindow == root_window;
|
||||
return g.FocusedWindow == g.CurrentWindow->RootWindow;
|
||||
}
|
||||
|
||||
bool ImGui::IsRootWindowOrAnyChildFocused()
|
||||
{
|
||||
ImGuiState& g = *GImGui;
|
||||
ImGuiWindow* root_window = g.CurrentWindow->RootWindow;
|
||||
return g.FocusedWindow && g.FocusedWindow->RootWindow == root_window;
|
||||
return g.FocusedWindow && g.FocusedWindow->RootWindow == g.CurrentWindow->RootWindow;
|
||||
}
|
||||
|
||||
bool ImGui::IsRootWindowOrAnyChildHovered()
|
||||
{
|
||||
ImGuiState& g = *GImGui;
|
||||
return g.HoveredRootWindow && (g.HoveredRootWindow == g.CurrentWindow->RootWindow) && IsWindowContentHoverable(g.HoveredRootWindow);
|
||||
}
|
||||
|
||||
float ImGui::GetWindowWidth()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue