kasemir / org.csstudio.display.builder

Update of org.csstudio.opibuilder.*
Eclipse Public License 1.0
2 stars 10 forks source link

Width and height swapped when horizontal is changed. #439

Closed claudio-rosati closed 6 years ago

claudio-rosati commented 6 years ago

This PR addressed what happens when horizontal is changed in ByteMonitor widget, moving from this situation

f1

to the following one

f2

The change happens in the model, because I don't think it is a representation business.

kasemir commented 6 years ago

In principle, good idea, but this exact implementation doesn't work because it's unconditionally swapping width & height.

Take examples/monitors_bytemonitor.bob. In there, Byte Monitor_3 is vertical, with width of 35 and height of 116. As the widget is loaded, the horizontal property listener detects that the widget is configured to be vertical, and swaps the size to width of 116 and height of 35.

Same happens to our operational displays like this motor detail where the "MSTA" is vertical, and width/height were erroneously swapped:

bm

I'll implement this in the representation, where toolkit.isEditMode() can detect that we're editing, and thus only apply the change 1) after the widget model has been loaded (which is the issue in this pull requrst) and 2) when interactively editing.

kasemir commented 6 years ago

Found a fix that works for existing displays yet triggers the width/height swap when editing. Will port from phoebus version.

kasemir commented 6 years ago

Try now.

claudio-rosati commented 6 years ago

You're right. Thank you.