Vertical progress bar causes Group widget to extend further than it should#3833
Vertical progress bar causes Group widget to extend further than it should#3833rjwills28 wants to merge 2 commits into
Conversation
A translation is applied to JFX progress bar to get a vertical bar but the width property of the bar remains unchanged and so the group pane think this child is wider than it should be and paints the group out to this width causing screen sizing problems.
|
|
While this is wrapping the JFX progress bar to better support rotating it, #3768 proposes a complete replacement. Which way to go here? |
|
Ah, I hadn't seen that PR. The replacement progress bar with an RTTank bank end much closer resembles the progress bar in CS-Studio and looks to be a nice improvement to the current one, which has few configurable properties. It's also nice that the use of it can be switched on/off making it backwards compatible and minimizing impact on existing screens. In my opinion I think we should pursue getting #3768 approved and merged. What do others think? I am can start testing it with some of our current converted screens. |



We discovered a fairly obscure bug when placing a vertical progress bar in a Group widget positioned on the far right edge of a screen. We were opening the window from the command line specifying the height and width so that it opening at the exact size of the screen, however we continued to get scroll bars on the window. We also found that if you right clicked to the right of the group, i.e. outside of the group, you would still get the option to view 'Group' information indicating that the Group had been drawn beyond its defined size.
I found that the cause of this was the vertical progress bar, which by default is horizontal and so a translation is applied to the node. However the width of the Progress bar node before the translation (i.e. the length of the bar) seems to remain the same width after the translation. So when it is placed in a Group widget it thinks that the width of the progress bar is much larger than it is and draws the Group out to the length of the progress bar.
E.g. Maybe easier to see in this example - note the right click menu option and the scroll bars
I have also attached an example BOB file:
progressbar_group.bob.txt
If you open this with
you will see that the right click menu extends to the right beyond the group and that you continued to get scroll bars even when the window is large enough to encompass the visible screen.
Something similar has been seen before as a potential bug in the JFX Progress bar, see https://bugs.openjdk.org/browse/JDK-8295341.
I have found a workaround for this issue which involves wrapping the progress bar in a JFX Pane() allowing us to rotate the progress bar as before but then set the correct width/height of the pane so that the Group widget doesn't think that this child element is bigger than it is. This fix gives the desired effect in that we can open the window to fit the screen without scroll bars appearing, e.g.

Checklist
Testing:
Documentation: