pcdshub / typhos

Automatic-yet-customizable Graphical User Interface Generation for Ophyd Devices
http://pcdshub.github.io/typhos
Other
16 stars 26 forks source link

BUG: Fix Positioner clipping #494

Closed ZLLentz closed 2 years ago

ZLLentz commented 2 years ago

Description

This changes the sizing strategy of the positioner widget from what was essentially fixed-width sizing to minimum size and expanding. This fixes cases where the positioner widget looked scrunched up or otherwise clipping.

Motivation and Context

It was reported in RIX that large numbers in the limits fields (in this case, 12 visible digits) would get clipped at the ends when rendered on the 4K high-dpi displays in the control room.

How Has This Been Tested?

Interactively only- need to run on the RIX control room machines to fully confirm.

Where Has This Been Documented?

Just this PR

Screenshots (if appropriate):

I don't have a high-dpi monitor at my desk, so to simulate and test this I would set the font side of the limits fields that were clipping on the control room display from 8pt to 50pt to guarantee clipping.

Here is what it looked like before: before-yesclip

And after: after-noclip

ZLLentz commented 2 years ago

I might do one more small change and drop the minimums down a bit smaller and see what the effects are, in case they help with cases where the widget can be smaller than the number I picked.

ZLLentz commented 2 years ago

A smaller starting size seems to have no effect- which means it's probably good because it covers our bases if someone pushes the widget to be a little smaller.

ZLLentz commented 2 years ago

automated test screenshot artifacts for both low and high DPI displays

This is sort of possible to emulate for text by doing some math and rescaling everything. You can take a screenshot with the point sizes of your local machine with your local dpi, do some math and figure out what the pixel sizes would be at other dpis. I think it might be feasible.

ZLLentz commented 2 years ago

Solving that problem though might be equivalent to finding a way for pydm to display all fonts the same size anyway