diff --git a/imgui.cpp b/imgui.cpp index 2e04738..5e4945e 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6648,7 +6648,8 @@ if (!ItemAdd(bb, &id)) return false; - if (window->DC.ItemFlags & ImGuiItemFlags_ButtonRepeat) flags |= ImGuiButtonFlags_Repeat; + if (window->DC.ItemFlags & ImGuiItemFlags_ButtonRepeat) + flags |= ImGuiButtonFlags_Repeat; bool hovered, held; bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags); @@ -10598,6 +10599,7 @@ bool value_changed = false, value_changed_h = false, value_changed_sv = false; + PushItemFlag(ImGuiItemFlags_NoNav, true); if (flags & ImGuiColorEditFlags_PickerHueWheel) { // Hue wheel + SV triangle logic @@ -10655,10 +10657,9 @@ value_changed = value_changed_h = true; } } - - // Alpha bar logic if (alpha_bar) { + // Alpha bar logic SetCursorScreenPos(ImVec2(bar1_pos_x, picker_pos.y)); InvisibleButton("alpha", ImVec2(bars_width, sv_picker_size)); if (IsItemActive()) @@ -10667,6 +10668,7 @@ value_changed = true; } } + PopItemFlag(); // ImGuiItemFlags_NoNav if (!(flags & ImGuiColorEditFlags_NoSidePreview)) { @@ -10687,6 +10689,7 @@ if (!(flags & ImGuiColorEditFlags_NoSidePreview)) { + PushItemFlag(ImGuiItemFlags_NoNavDefaultFocus, true); ImVec4 col_v4(col[0], col[1], col[2], (flags & ImGuiColorEditFlags_NoAlpha) ? 1.0f : col[3]); if ((flags & ImGuiColorEditFlags_NoLabel)) Text("Current"); @@ -10701,6 +10704,7 @@ value_changed = true; } } + PopItemFlag(); EndGroup(); } diff --git a/imgui.cpp b/imgui.cpp index 2e04738..5e4945e 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6648,7 +6648,8 @@ if (!ItemAdd(bb, &id)) return false; - if (window->DC.ItemFlags & ImGuiItemFlags_ButtonRepeat) flags |= ImGuiButtonFlags_Repeat; + if (window->DC.ItemFlags & ImGuiItemFlags_ButtonRepeat) + flags |= ImGuiButtonFlags_Repeat; bool hovered, held; bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags); @@ -10598,6 +10599,7 @@ bool value_changed = false, value_changed_h = false, value_changed_sv = false; + PushItemFlag(ImGuiItemFlags_NoNav, true); if (flags & ImGuiColorEditFlags_PickerHueWheel) { // Hue wheel + SV triangle logic @@ -10655,10 +10657,9 @@ value_changed = value_changed_h = true; } } - - // Alpha bar logic if (alpha_bar) { + // Alpha bar logic SetCursorScreenPos(ImVec2(bar1_pos_x, picker_pos.y)); InvisibleButton("alpha", ImVec2(bars_width, sv_picker_size)); if (IsItemActive()) @@ -10667,6 +10668,7 @@ value_changed = true; } } + PopItemFlag(); // ImGuiItemFlags_NoNav if (!(flags & ImGuiColorEditFlags_NoSidePreview)) { @@ -10687,6 +10689,7 @@ if (!(flags & ImGuiColorEditFlags_NoSidePreview)) { + PushItemFlag(ImGuiItemFlags_NoNavDefaultFocus, true); ImVec4 col_v4(col[0], col[1], col[2], (flags & ImGuiColorEditFlags_NoAlpha) ? 1.0f : col[3]); if ((flags & ImGuiColorEditFlags_NoLabel)) Text("Current"); @@ -10701,6 +10704,7 @@ value_changed = true; } } + PopItemFlag(); EndGroup(); } diff --git a/imgui_internal.h b/imgui_internal.h index 5b59b68..e2920a4 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -178,7 +178,7 @@ ImGuiButtonFlags_FlattenChilds = 1 << 5, // allow interactions even if a child window is overlapping ImGuiButtonFlags_DontClosePopups = 1 << 6, // disable automatically closing parent popup on press // [UNUSED] ImGuiButtonFlags_Disabled = 1 << 7, // disable interactions - ImGuiButtonFlags_AlignTextBaseLine = 1 << 8, // vertically align button to match text baseline - ButtonEx() only + ImGuiButtonFlags_AlignTextBaseLine = 1 << 8, // vertically align button to match text baseline - ButtonEx() only // FIXME: Should be removed and handled SmallButton(), not possible currently because of DC.CursorPosPrevLine ImGuiButtonFlags_NoKeyModifiers = 1 << 9, // disable interaction if a key modifier is held ImGuiButtonFlags_AllowOverlapMode = 1 << 10, // require previous frame HoveredId to either match id or be null before being usable ImGuiButtonFlags_NoNavOverride = 1 << 11 // don't override navigation id when activated