mirror of
https://github.com/Drezil/imgui.git
synced 2025-03-31 00:12:44 +00:00
ButtonBehavior: Tidying up.
This commit is contained in:
parent
4b4e455c40
commit
dd0855de5c
@ -6589,7 +6589,9 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
|
||||
}
|
||||
|
||||
bool held = false;
|
||||
if (g.ActiveId == id && g.ActiveIdSource == ImGuiInputSource_Mouse)
|
||||
if (g.ActiveId == id)
|
||||
{
|
||||
if (g.ActiveIdSource == ImGuiInputSource_Mouse)
|
||||
{
|
||||
if (g.IO.MouseDown[0])
|
||||
{
|
||||
@ -6605,9 +6607,12 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
|
||||
if (!(flags & ImGuiButtonFlags_NoNavOverride))
|
||||
g.NavDisableHighlight = true;
|
||||
}
|
||||
if (g.ActiveId == id && g.ActiveIdSource == ImGuiInputSource_Nav)
|
||||
else if (g.ActiveIdSource == ImGuiInputSource_Nav)
|
||||
{
|
||||
if (!IsNavInputDown(ImGuiNavInput_PadActivate))
|
||||
ClearActiveID();
|
||||
}
|
||||
}
|
||||
|
||||
// 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.
|
||||
if (hovered && (flags & ImGuiButtonFlags_AllowOverlapMode) && (g.HoveredIdPreviousFrame != id && g.HoveredIdPreviousFrame != 0))
|
||||
|
Loading…
x
Reference in New Issue
Block a user