imgui
imgui copied to clipboard
imguidatechooser does not display correctly
When windows dpi scaling is respected, for example:
static float scale = 1.0;
auto currentMonitorScale = getWindow().getCurrentMonitorContentScale(); // this is glfwGetWindowContentScale()
if (currentMonitorScale.y != scale)
{
ImGui::GetStyle().ScaleAllSizes(currentMonitorScale.y / scale);
ImGui::GetIO().FontGlobalScale = currentMonitorScale.y;
scale = currentMonitorScale.y;
}
Then imguidatechooser ends up rendering a scrollbar which blocks the UI.
Example at 350% display scaling

To be clear the issue also shows up at anywhere above 125%+ display scaling setting in windows. It is not exclusive to the 350% example image
Unluckily I don't own a Mac, so I can't reproduce this behavior, and fix it. I don't even know what "windows dpi scaling is respected" means :smiling_face_with_tear: !
Some question to better understand the issue:
- If you run the demo without your scaling code, does it look better?
- Is it something related to "retina-display" screens or something like that?
- Is imguidatechooser the only widget that gets broken with your "scaling code" or it affects other widgets too?
- And does it cause artifacts in plain Dear ImGui demos (I mean in the upstream repository, not in my Addons)?
If I can't replicate the problem, I still accept a Pull Request by users.
But if you just need a DateChooser widget and nothing more, you can try and see if the one made by @epezent:
inside imguiplot is more robust than mine (for sure it looks better!).
I've discoved it HERE. And if you plan to use imguiplot you get it for free, otherwise you must extract the relative code to test it.
This is microsoft windows, not Mac OS. You can access the windows scaling setting using
Settings > Display > Scale & Layout > Scale = 200%
The idea is to have a larger UI when using a high dpi screen, for example 4k on a 13" laptop
Thanks for the heads up on epezent's date chooser, thats actually more suitable because it has time which I need too.
You can reproduce it by setting currentMonitorScale.y to 2.0 which represents 200% scaling.
Settings > Display > Scale & Layout > Scale = 200%
Tried: the screen zoomed 4 times, I could only interact with the top-left corner of the screen, and had to hard reset the system. No options to scale below 100%. So in short I cannot test any code with Scale!=100% on my PC.
Thanks for the heads up on epezent's date chooser, thats actually more suitable because it has time which I need too.
You're welcome. implot is made by a single .h/.cpp file so it should be easy to use.
P.S. I'm on Ubuntu Linux not on Windows.