Browse Source

InputText: leave state->Flags uncleared for the purpose of backends emitting an on-screen keyboard for passwords. (#5724)

ocornut 2 years ago
parent
commit
d17627b9c6
3 changed files with 2 additions and 5 deletions
  1. 1 1
      imgui.h
  2. 1 1
      imgui_internal.h
  3. 0 3
      imgui_widgets.cpp

+ 1 - 1
imgui.h

@@ -23,7 +23,7 @@
 // Library Version
 // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM > 12345')
 #define IMGUI_VERSION               "1.89 WIP"
-#define IMGUI_VERSION_NUM           18824
+#define IMGUI_VERSION_NUM           18825
 #define IMGUI_HAS_TABLE
 
 /*

+ 1 - 1
imgui_internal.h

@@ -1025,7 +1025,7 @@ struct IMGUI_API ImGuiInputTextState
     bool                    CursorFollow;           // set when we want scrolling to follow the current cursor position (not always!)
     bool                    SelectedAllMouseLock;   // after a double-click to select all, we ignore further mouse drags to update selection
     bool                    Edited;                 // edited this frame
-    ImGuiInputTextFlags     Flags;                  // copy of InputText() flags
+    ImGuiInputTextFlags     Flags;                  // copy of InputText() flags. may be used to check if e.g. ImGuiInputTextFlags_Password is set.
 
     ImGuiInputTextState()                   { memset(this, 0, sizeof(*this)); }
     void        ClearText()                 { CurLenW = CurLenA = 0; TextW[0] = 0; TextA[0] = 0; CursorClamp(); }

+ 0 - 3
imgui_widgets.cpp

@@ -4590,9 +4590,6 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
                 apply_new_text_length = state->CurLenA;
             }
         }
-
-        // Clear temporary user storage
-        state->Flags = ImGuiInputTextFlags_None;
     }
 
     // Copy result to user buffer. This can currently only happen when (g.ActiveId == id)