Skip to content

Commit 54c1bde

Browse files
committed
Internals: removed unused ImGuiItemStatusFlags_FocusedByTabbing. (#4449)
Amend 1a7526d
1 parent 4afffa3 commit 54c1bde

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

imgui_internal.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -835,9 +835,8 @@ enum ImGuiItemStatusFlags_
835835
ImGuiItemStatusFlags_HasDeactivated = 1 << 5, // Set if the widget/group is able to provide data for the ImGuiItemStatusFlags_Deactivated flag.
836836
ImGuiItemStatusFlags_Deactivated = 1 << 6, // Only valid if ImGuiItemStatusFlags_HasDeactivated is set.
837837
ImGuiItemStatusFlags_HoveredWindow = 1 << 7, // Override the HoveredWindow test to allow cross-window hover testing.
838-
ImGuiItemStatusFlags_FocusedByTabbing = 1 << 8, // Set when the Focusable item just got focused by Tabbing (FIXME: to be removed soon)
839-
ImGuiItemStatusFlags_Visible = 1 << 9, // [WIP] Set when item is overlapping the current clipping rectangle (Used internally. Please don't use yet: API/system will change as we refactor Itemadd()).
840-
ImGuiItemStatusFlags_HasClipRect = 1 << 10, // g.LastItemData.ClipRect is valid
838+
ImGuiItemStatusFlags_Visible = 1 << 8, // [WIP] Set when item is overlapping the current clipping rectangle (Used internally. Please don't use yet: API/system will change as we refactor Itemadd()).
839+
ImGuiItemStatusFlags_HasClipRect = 1 << 9, // g.LastItemData.ClipRect is valid
841840

842841
// Additional status + semantic for ImGuiTestEngine
843842
#ifdef IMGUI_ENABLE_TEST_ENGINE

imgui_widgets.cpp

+6-9
Original file line numberDiff line numberDiff line change
@@ -2427,14 +2427,13 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data,
24272427
if (!temp_input_is_active)
24282428
{
24292429
// Tabbing or CTRL-clicking on Drag turns it into an InputText
2430-
const bool input_requested_by_tabbing = temp_input_allowed && (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_FocusedByTabbing) != 0;
24312430
const bool clicked = hovered && IsMouseClicked(0, id);
24322431
const bool double_clicked = (hovered && g.IO.MouseClickedCount[0] == 2 && TestKeyOwner(ImGuiKey_MouseLeft, id));
2433-
const bool make_active = (input_requested_by_tabbing || clicked || double_clicked || g.NavActivateId == id);
2432+
const bool make_active = (clicked || double_clicked || g.NavActivateId == id);
24342433
if (make_active && (clicked || double_clicked))
24352434
SetKeyOwner(ImGuiKey_MouseLeft, id);
24362435
if (make_active && temp_input_allowed)
2437-
if (input_requested_by_tabbing || (clicked && g.IO.KeyCtrl) || double_clicked || (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput)))
2436+
if ((clicked && g.IO.KeyCtrl) || double_clicked || (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput)))
24382437
temp_input_is_active = true;
24392438

24402439
// (Optional) simple click (without moving) turns Drag into an InputText
@@ -3019,13 +3018,12 @@ bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* p_dat
30193018
if (!temp_input_is_active)
30203019
{
30213020
// Tabbing or CTRL-clicking on Slider turns it into an input box
3022-
const bool input_requested_by_tabbing = temp_input_allowed && (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_FocusedByTabbing) != 0;
30233021
const bool clicked = hovered && IsMouseClicked(0, id);
3024-
const bool make_active = (input_requested_by_tabbing || clicked || g.NavActivateId == id);
3022+
const bool make_active = (clicked || g.NavActivateId == id);
30253023
if (make_active && clicked)
30263024
SetKeyOwner(ImGuiKey_MouseLeft, id);
30273025
if (make_active && temp_input_allowed)
3028-
if (input_requested_by_tabbing || (clicked && g.IO.KeyCtrl) || (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput)))
3026+
if ((clicked && g.IO.KeyCtrl) || (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput)))
30293027
temp_input_is_active = true;
30303028

30313029
if (make_active && !temp_input_is_active)
@@ -4178,7 +4176,6 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
41784176
if (is_resizable)
41794177
IM_ASSERT(callback != NULL); // Must provide a callback if you set the ImGuiInputTextFlags_CallbackResize flag!
41804178

4181-
const bool input_requested_by_tabbing = (item_status_flags & ImGuiItemStatusFlags_FocusedByTabbing) != 0;
41824179
const bool input_requested_by_nav = (g.ActiveId != id) && ((g.NavActivateId == id) && ((g.NavActivateFlags & ImGuiActivateFlags_PreferInput) || (g.NavInputSource == ImGuiInputSource_Keyboard)));
41834180

41844181
const bool user_clicked = hovered && io.MouseClicked[0];
@@ -4190,7 +4187,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
41904187
float scroll_y = is_multiline ? draw_window->Scroll.y : FLT_MAX;
41914188

41924189
const bool init_changed_specs = (state != NULL && state->Stb.single_line != !is_multiline); // state != NULL means its our state.
4193-
const bool init_make_active = (user_clicked || user_scroll_finish || input_requested_by_nav || input_requested_by_tabbing);
4190+
const bool init_make_active = (user_clicked || user_scroll_finish || input_requested_by_nav);
41944191
const bool init_state = (init_make_active || user_scroll_active);
41954192
if ((init_state && g.ActiveId != id) || init_changed_specs)
41964193
{
@@ -4240,7 +4237,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
42404237
select_all = true;
42414238
if (input_requested_by_nav && (!recycle_state || !(g.NavActivateFlags & ImGuiActivateFlags_TryToPreserveState)))
42424239
select_all = true;
4243-
if (input_requested_by_tabbing || (user_clicked && io.KeyCtrl))
4240+
if (user_clicked && io.KeyCtrl)
42444241
select_all = true;
42454242
}
42464243

0 commit comments

Comments
 (0)