mirror of
https://github.com/Drezil/imgui.git
synced 2025-09-15 15:43:14 +02:00
Nav: Disabled items are not candidate for default focus. (#211, #787) + simplify handling of ImGuiButtonFlags_PressedOnDragDropHold path.
This commit is contained in:
@ -527,7 +527,7 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
|
||||
{
|
||||
hovered = true;
|
||||
SetHoveredID(id);
|
||||
if (CalcTypematicRepeatAmount(g.HoveredIdTimer + 0.0001f - g.IO.DeltaTime, g.HoveredIdTimer + 0.0001f, DRAGDROP_HOLD_TO_OPEN_TIMER, 0.00f))
|
||||
if (g.HoveredIdTimer - g.IO.DeltaTime <= DRAGDROP_HOLD_TO_OPEN_TIMER && g.HoveredIdTimer >= DRAGDROP_HOLD_TO_OPEN_TIMER)
|
||||
{
|
||||
pressed = true;
|
||||
g.DragDropHoldJustPressedId = id;
|
||||
@ -6140,7 +6140,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
|
||||
if (flags & ImGuiSelectableFlags_Disabled)
|
||||
{
|
||||
ImGuiItemFlags backup_item_flags = g.CurrentItemFlags;
|
||||
g.CurrentItemFlags |= ImGuiItemFlags_Disabled | ImGuiItemFlags_NoNavDefaultFocus;
|
||||
g.CurrentItemFlags |= ImGuiItemFlags_Disabled;
|
||||
item_add = ItemAdd(bb, id);
|
||||
g.CurrentItemFlags = backup_item_flags;
|
||||
}
|
||||
|
Reference in New Issue
Block a user