ngscopeclient / scopehal-apps

ngscopeclient and other client applications for libscopehal.
https://www.ngscopeclient.org/
BSD 3-Clause "New" or "Revised" License
584 stars 93 forks source link

macOS: Scale GUI for Retina displays #625

Closed rgov closed 7 months ago

rgov commented 11 months ago

The GUI is awkwardly scaled on macOS, where most Apple displays are going to be high DPI ("Retina"). Compare the menu text with the titlebar which is the normal system font size. The toolbar items look the right size.

image

There's some discussion here: https://github.com/ocornut/imgui/issues/3757

rgov commented 11 months ago

GDK_SCALE=2 doesn't do it (#255 etc.)

azonenberg commented 11 months ago

ngscopeclient doesn't use GTK, so any of the pre-2022 issues about scaling won't be relevant.

Font scaling is calculated based on GetContentScale() from imgui (see MainWindow::UpdateFonts()).

Is it possible there's a double scaling going on where the OS is trying to scale fonts and the application also is, and they're stepping on each other?

azonenberg commented 11 months ago

Most UI elements are calculated with sizes based on the font size, so as text size scales everything else should scale to match.

So the root cause is likely the font scaling factor being off somehow.

rgov commented 7 months ago

Looks great, thanks @d235j!

image