in-sideFX / Undecorator

Decorate "Undecorated" JavaFX windows
118 stars 30 forks source link

Window border size not preserved when nodes are changed #1

Open andytill opened 11 years ago

andytill commented 11 years ago

Excellent project, many thanks! I am trying to use it in my own project, EstiMate but have run into an issue.

I have my own container FXML called rootView.fxml, I put a login control in rootView and set that as the Undecorated control. When the user logs in I put a main screen in the root view, this replaces the login screen. The undecorator no longer has the correct border size.

Do you know of any issues when switching around nodes inside the Undecorator control? Below is a screen shot.

Thanks!

EstiMateWin8

andytill commented 11 years ago

You can recreate this issue using the following program.

import insidefx.undecorator.UndecoratorScene;
import javafx.application.Application;
import javafx.scene.control.Button;
import javafx.stage.Stage;

public class UndecoratorApp extends Application {

    @Override
    public void start(final Stage stage) throws Exception {

        // The Undecorator as a Scene
        UndecoratorScene undecoratorScene = new UndecoratorScene(stage, new Button("Hello"));

        // Set minimum size
        stage.setMinWidth(500);
        stage.setMinHeight(600);

         stage.setScene(undecoratorScene);

         stage.show();
     }

     public static void main(String[] args) {
         launch(args);
    }
}
in-sideFX commented 10 years ago

Hi, Indeed, this could lead to a problem... The client area is part of bounds calculation so if it is changed it may produce unexpected results. Do you have to the same issue if you use an intermediate Pane where you load both the login and the second screen into this one? Thanks.

andytill commented 10 years ago

Hi! It did use an intermediate pane. I think this is basically the same issue as #3 where the min size of the content area is not used, you can use the sample program to recreate. Thanks