Flix01 / imgui

Dear ImGui Addons Branch = plain unmodified dear imgui plus some extra addon.
https://github.com/Flix01/imgui/wiki/ImGui-Addons-Branch-Home
MIT License
396 stars 34 forks source link

imguidatechooser does not display correctly #69

Open aCuria opened 1 year ago

aCuria commented 1 year ago

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 image

aCuria commented 1 year ago

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

Flix01 commented 1 year ago

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 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: image 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.

aCuria commented 1 year ago

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.

Flix01 commented 1 year ago

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.