Skip to content

Configure stage size and position before it is shown - #4027

Open
rjwills28 wants to merge 2 commits into
ControlSystemStudio:masterfrom
rjwills28:improve_opening_new_stage
Open

rjwills28 wants to merge 2 commits into
ControlSystemStudio:masterfrom
rjwills28:improve_opening_new_stage

Conversation

@rjwills28

Copy link
Copy Markdown
Contributor

When opening a display in a new window from an action button the code would previously create a stage at a default size and show it, before then resizing it to the correct size and position. This could produce a flicker across the display as the screen first gets shown at the default size and position (which is a larger screen somewhere in the middle of the display) and then quickly gets moved and resized to where it should be.

There was a bug in JFX21 that meant this was the way we had to do it. The bug related to the width and height not being applied properly before stage.show() meaning you needed to show the stage before you could resize. But this has been fixed in JFX25 so we can now both remove the flicker from the new window jumping and tidy up the code.

This change establishes what the x,y, height and width should be before creating the stage and constructs a Geometry object from a string (instead of null) to pass into the stage configuration method, which should be a much tidier implementation.

I have also shrunk down the margins for the standalone windows as they do not need to be so big.

Checklist

  • Testing:

    • The feature has automated tests
    • Tests were run
    • If not, explain how you tested your changes
  • Documentation:

    • The feature is documented
    • The documentation is up to date
    • Release notes:
      • Added an entry if the change is breaking or significant
      • Added an entry when adding a new feature

when opening a display in a new window from an action. This avoids
flickering due to the unnecessary resizing and repositioning of
the stage.
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant