Skip to content

Input text cursor rendering issues #7031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tpecholt opened this issue Nov 19, 2023 · 6 comments
Open

Input text cursor rendering issues #7031

tpecholt opened this issue Nov 19, 2023 · 6 comments

Comments

@tpecholt
Copy link

Version/Branch of Dear ImGui:

Version: 1.90
Branch: docking

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_android.cpp + imgui_impl_opengl3.cpp
Compiler: Android NDK Clang
Operating System: Android

My Issue/Question:

I would like the rendering of the text cursor in input controls to be more configurable.

  1. Right now the rendering is done by drawing a 1px line. That is problematic with DPI scaling so the cursor is barely visible.

  2. The color should be configurable too currently it is fixed to ImGuiCol_Text. Android uses different color for text cursor and text.

Screenshots/Video

cursor

@ocornut
Copy link
Owner

ocornut commented Nov 29, 2023

We don't have a standardized mechanism to specify general/global scaling and would probably wait until we have one.

Similarly I don't disagree we could have a specific color for it but it likely would have to wait until we update the style system to avoid cluttering out existing list.

@tope99
Copy link

tope99 commented Nov 29, 2023

Yes but the difference is for other settings like WindowPadding, ItemSpacing... I can call ImStyle::ScaleAllSizes(). And as for fonts I can load them with scaled size. So using existing functionality I am already able to achieve DPI scaling of UI elements. But the width of the text cursor is fixed so I can't scale it unless I directly modify ImGui code.

@tksuoran
Copy link

I would also like to have configurable cursor color.

@ocornut
Copy link
Owner

ocornut commented Mar 19, 2025

For scaling, I'm currently working on general scaling system and standardized scaling factor so I would like this to be part of it and not another style variable. But I could add the color sooner.

ocornut added a commit that referenced this issue Mar 19, 2025
@ocornut
Copy link
Owner

ocornut commented Mar 19, 2025

I've added a color for the cursor.
I cannot add the thickness scale yet because the way this will be exposed depends on questions I don't have the right answer just yet (but actively working on it).

@tksuoran
Copy link

Awesome - Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants