pcdshub / typhos

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

ENH: positioner row widget sizing usability fixes and tweaks #611

Closed ZLLentz closed 2 weeks ago

ZLLentz commented 4 weeks ago

Description

Rework the design, sizing, and font scaling of the positioner row widget to address concerns about readability in RIX for devices with large position numbers, and to address issues with poorly used space in state devices.

Full list of changes:

dynamic_font.py:

panel.py

positioner.py

test_dynamic_font.py

PositionerBase.embedded.ui

positioner.ui

positioner_row.ui

Motivation and Context

How Has This Been Tested?

Where Has This Been Documented?

Need to revise the pre-release notes one more time

Screenshots:

Before small: image

Before wide: image

After small: image

After wide: image

After default size with default size/location expansion pop-outs: image

Pre-merge checklist

ZLLentz commented 4 weeks ago

I'm going to finish up the testing and documentation todo stuff and then I'm going to adjust how I implemented the dynamic sizing. I've realized some basic tricks for making these sorts of composite widgets cleanly rescaleable in all directions while maintaining proportions and while only needing specification in the ui file (rather than my current code here which does a lot of extra stuff in the py files that it shouldn't need to if the ui is set up correctly). In essence: the only sizing rule that we'll need to keep track of in code is the dynamic font resizing, which I plan to attach to all of the text widgets instead of just some of them.

I might also take a stab at fixing the resizing for the square widget while I'm here if I'm feeling motivated.

ZLLentz commented 3 weeks ago

I like where this is at now

I didn't quite get to implementing the splitters idea, because the way the basic and composite signal panels are implemented (as a QWidget that is also itself a QGridLayout) makes this somewhat annoying to implement. There will need to be a sizable refactor to achieve this. (Now: add rows to a grid layout that is actually a typhos panel, later: add rows to a splitter area? And maintain the grid sizing? And only have splitters between subdevices, not between signals?)

The splitters idea will become an issue for implementing later since I think it would be helpful in a lot of cases.

I am going to clean up the description for documentation purposes but I don't plan on modifying the code again until next PR unless there are code quality issues or bugs. I think after this PR I'll switch to going through the most recent typhos issues.

ZLLentz commented 3 weeks ago

This is now reviewable so I'm going to mark as ready for review. I still will revise the pre-release notes one more time.

ZLLentz commented 3 weeks ago

I also want to make a companion PR on pcdsdevices, I'll try not to forget. This works by itself but there's a couple more things to tweak (such as the ??? rendering of the disabled signal)

tangkong commented 3 weeks ago

wowee this is a biggun

A few notes from interactive testing:

I'll give the code a read through now

ZLLentz commented 3 weeks ago

I'm not entirely sure how to mock high-dpi displays

I've tried using a VM for this in the past with mixed results. We have a new "like a hutch" test area coming online soon thankfully. I should double-check the final version of this in RIX before merging.

Some strange clipping in non-positioner widgets

I need to investigate and resolve this prior to merging, this is a blocker.

windows rendered too tall for my monitor, with no ability to scroll to the bottom

This is related to #599 and I'm planning to fix it before the tag but not during this PR. There's a hotfix for it in dev_conda.

windows getting left behind

This is a valid concern and should be addressed before merging. Parenting the widgets properly actually made them disappear... which confused me.

a thin horizontal line between the positioner widgets would be helpful

Vincent also suggested this at some point and I agree. I had been intending to simply use the splitters but since I punted on it maybe I need to address that now.

ZLLentz commented 3 weeks ago

One more dumb bug I need to resolve: the text snaps back to minimum size before and after a move image

ZLLentz commented 3 weeks ago

Another dumb "only while moving real things" bug: the combobox text gets ~repeatedly bigger and bigger and each time you click on it...~ bigger once the first time you click on it image

ZLLentz commented 3 weeks ago

Text getting small is because pydm is manually resetting the style on certain metadata events. It seems like the only way around this is to also set the stylesheet to have the font specifier in it, so I'll try that.

ZLLentz commented 3 weeks ago

Setting the stylesheet fixed both the big big font and the tiny tiny font issues

ZLLentz commented 3 weeks ago

The only remaining fix I'm going to do here is to address:

Some strange clipping in non-positioner widgets

After that, I'll round up the remaining items into tickets:

ZLLentz commented 3 weeks ago

side-by-side of old and new which shows off the sizing updates and shows how much is being clipped with the bug image

ZLLentz commented 3 weeks ago

Left: fixed clipping in default view Right: expanding to +config view shows more and dynamically resizes Changing the views to remove items also shrinks the widgets to remove the whitespace image

ZLLentz commented 3 weeks ago

There's only one more situation where the sizing is wrong- when the signal panel has no entries in it at all. Maybe this becomes a ticket to fix later, too. (I'll try a bit before today ends)

ZLLentz commented 3 weeks ago

Remaining issue is that subdevices of subdevices don't collapse properly when vanished... my first try at that one caused more issues so this might be where I leave it for now.