mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-17 01:04:19 +00:00
ButtonBehavior, ImGuiButtonFlags_FlattenChildren flag can be used from a child window. Would typically affect calling SplitterBehavior() from a child window.
This commit is contained in:
parent
d348d86df4
commit
059560d28b
1 changed files with 3 additions and 2 deletions
|
|
@ -392,7 +392,8 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
|
||||||
flags |= ImGuiButtonFlags_PressedOnClickRelease;
|
flags |= ImGuiButtonFlags_PressedOnClickRelease;
|
||||||
|
|
||||||
ImGuiWindow* backup_hovered_window = g.HoveredWindow;
|
ImGuiWindow* backup_hovered_window = g.HoveredWindow;
|
||||||
if ((flags & ImGuiButtonFlags_FlattenChildren) && g.HoveredRootWindow == window)
|
const bool flatten_hovered_children = (flags & ImGuiButtonFlags_FlattenChildren) && g.HoveredRootWindow == window->RootWindow;
|
||||||
|
if (flatten_hovered_children)
|
||||||
g.HoveredWindow = window;
|
g.HoveredWindow = window;
|
||||||
|
|
||||||
bool pressed = false;
|
bool pressed = false;
|
||||||
|
|
@ -415,7 +416,7 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flags & ImGuiButtonFlags_FlattenChildren) && g.HoveredRootWindow == window)
|
if (flatten_hovered_children)
|
||||||
g.HoveredWindow = backup_hovered_window;
|
g.HoveredWindow = backup_hovered_window;
|
||||||
|
|
||||||
// AllowOverlap mode (rarely used) requires previous frame HoveredId to be null or to match. This allows using patterns where a later submitted widget overlaps a previous one.
|
// AllowOverlap mode (rarely used) requires previous frame HoveredId to be null or to match. This allows using patterns where a later submitted widget overlaps a previous one.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue