Oshan96 / CustomStage

A JavaFX UI framework to create fully customized undecorated windows
Apache License 2.0
199 stars 18 forks source link

Fixed minimum dimensions #12

Closed SimonMeili closed 5 years ago

SimonMeili commented 5 years ago

If we create a stage which is smaller than 259x700 it gets resized to 259x700 the first time a user tries to change the window size manually (by dragging the edges of the window).

We suspect the error to be in lk.vivoxalabs.customstage.tools.ResizeHelper:17. Is there a specific reason for fixing the minimum dimensions to 259x700?

Oshan96 commented 5 years ago

Hi there @SimonMeili ! I think the issue you're having that issue because you're not explicitly declaring minimum dimensions of your stage so the stage is created with 259x700 minimum dimensions, by default(as it is in lk.vivoxalabs.customstage.tools.ResizeHelper:17). However, you can override these minimum 259x700 dimension cap if you use setDimensions(double minWidth,double minHeight,double maxWidth,double maxHeight) method which is provided in CustomStageBuilder class.

As for an example, you can create your customstage with 200x200 minimum dimensions like this;

CustomStage stage = new CustomStageBuilder()
    .setDimensions(200,200,1920,1280)
    .build();

Hope this will fix it for you! :) Checkout the detailed wiki page so you can actually learn how to use CustomStage upto it's fully capabilities! And you can see all these different ways to build your CustomStage if you go through the sample codes in examples directory. Also you can use the CustomStage API as well for further info.