io.OptNoCursorBlink -> io.OptCursorBlink (#1427)

This commit is contained in:
omar 2017-11-12 16:06:44 +01:00
parent 669498ff26
commit 30bf40195b
2 changed files with 3 additions and 3 deletions

View File

@ -780,7 +780,7 @@ ImGuiIO::ImGuiIO()
#else #else
OptMacOSXBehaviors = false; OptMacOSXBehaviors = false;
#endif #endif
OptNoCursorBlink = false; OptCursorBlink = true;
// Settings (User Functions) // Settings (User Functions)
RenderDrawListsFn = NULL; RenderDrawListsFn = NULL;
@ -8494,7 +8494,7 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2
draw_window->DrawList->AddText(g.Font, g.FontSize, render_pos - render_scroll, GetColorU32(ImGuiCol_Text), buf_display, buf_display + edit_state.CurLenA, 0.0f, is_multiline ? NULL : &clip_rect); draw_window->DrawList->AddText(g.Font, g.FontSize, render_pos - render_scroll, GetColorU32(ImGuiCol_Text), buf_display, buf_display + edit_state.CurLenA, 0.0f, is_multiline ? NULL : &clip_rect);
// Draw blinking cursor // Draw blinking cursor
bool cursor_is_visible = (g.IO.OptNoCursorBlink) || (g.InputTextState.CursorAnim <= 0.0f) || fmodf(g.InputTextState.CursorAnim, 1.20f) <= 0.80f; bool cursor_is_visible = (!g.IO.OptCursorBlink) || (g.InputTextState.CursorAnim <= 0.0f) || fmodf(g.InputTextState.CursorAnim, 1.20f) <= 0.80f;
ImVec2 cursor_screen_pos = render_pos + cursor_offset - render_scroll; ImVec2 cursor_screen_pos = render_pos + cursor_offset - render_scroll;
ImRect cursor_screen_rect(cursor_screen_pos.x, cursor_screen_pos.y-g.FontSize+0.5f, cursor_screen_pos.x+1.0f, cursor_screen_pos.y-1.5f); ImRect cursor_screen_rect(cursor_screen_pos.x, cursor_screen_pos.y-g.FontSize+0.5f, cursor_screen_pos.x+1.0f, cursor_screen_pos.y-1.5f);
if (cursor_is_visible && cursor_screen_rect.Overlaps(clip_rect)) if (cursor_is_visible && cursor_screen_rect.Overlaps(clip_rect))

View File

@ -804,7 +804,7 @@ struct ImGuiIO
// Advanced/subtle behaviors // Advanced/subtle behaviors
bool OptMacOSXBehaviors; // = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl bool OptMacOSXBehaviors; // = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl
bool OptNoCursorBlink; // = false // Disable blinking cursor bool OptCursorBlink; // = true // Enable blinking cursor, for users who consider it annoying.
//------------------------------------------------------------------ //------------------------------------------------------------------
// Settings (User Functions) // Settings (User Functions)