You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, amazing tool to work with, thank you a lot.
I was wondering if it there was a way to disable resizing/maximizing of the stage.
I tried to use setResizeable() but I suppose you are overriding this function since you rewrote the whole resizing process yourself.
I also tried to listen for attempts to maximize then set maximize to false but your codes set it back to true.
Custom Stage itself is a private class so I cannot extend/override it.
Any idea ?
The text was updated successfully, but these errors were encountered:
Hi @LaureLazard good to hear you found CustomStage to be useful for your work!
And to answer your question(s),
You can't change it using setResizable() since the functionality is not supported by default for undecorated windows (thus, the separate implementation).
If you try to remove the listeners on resize events, you probably won't be able to perform that since the event is set for each and every Node in your UI recursively once it is called (since there is an issue in resizing an undecorated window so you have to manually resize every node with their child nodes once a resize occurs)
No. CustomStage is a public class and you can directly use it (which has no resize listener set on it) and can override it. CustomStage itself is not responsible of resizing events.
The resize listener is set at the constructor of the CustomStageBuilder class which acts as an interface to easily build CustomStages with minimal effort, correctly. If you check the code there, I have used the ResizeHelper class to set the resize listeners. So, if you study the code in the builder class, and create your own CustomStage (without setting the ResizeListener) you should have an undecorated stage with all the functionality of CustomStage except for resize. Furthermore, you can then write your own resize listener class (follow the current ResizeListener to get an idea?) and then pass your CustomStage instance to it (if you followed the same pattern as ResizeHelper class) you can integrate it into your instance as well.
And, if you want the ability to maximize the stage gone, just take out the maximize button when you set the three (minimize, maximize, close) buttons, and it should be solved.
Hope this helps and solves your issue :)
PS: I just realized the current implementation of ResizeHelper and the ResizeListener does a recursive call to resize all the nodes and their children which can be quite ineffective at runtime and can even cause stackoverflaw errors. Should come up with a better way to handle it so that users will have smooth transitions when resizing (if you come up with a better implementation feel free to do a PR here. I'll study the code and merge it to the code).
Hi, amazing tool to work with, thank you a lot.
I was wondering if it there was a way to disable resizing/maximizing of the stage.
I tried to use
setResizeable()
but I suppose you are overriding this function since you rewrote the whole resizing process yourself.I also tried to listen for attempts to maximize then set maximize to false but your codes set it back to true.
Custom Stage itself is a private class so I cannot extend/override it.
Any idea ?
The text was updated successfully, but these errors were encountered: