Skip to content

Commit

Permalink
apply floating property before undocked events generated
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertBColton committed Apr 21, 2018
1 parent 8d44134 commit e66e091
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/main/java/org/dockfx/DockNode.java
Expand Up @@ -242,6 +242,12 @@ public void setFloating(boolean floating, Point2D translation) {
dockTitleBar.setVisible(this.isCustomTitleBar());
dockTitleBar.setManaged(this.isCustomTitleBar());

// apply the floating property so we can get its padding size
// while it is floating to offset it by the drop shadow
// this way it pops out above exactly where it was when docked
this.floatingProperty.set(floating);
this.applyCss();

if (this.isDocked()) {
this.undock();
}
Expand Down Expand Up @@ -279,12 +285,6 @@ public void setFloating(boolean floating, Point2D translation) {

Scene scene = new Scene(borderPane);

// apply the floating property so we can get its padding size
// while it is floating to offset it by the drop shadow
// this way it pops out above exactly where it was when docked
this.floatingProperty.set(floating);
this.applyCss();

// apply the border pane css so that we can get the insets and
// position the stage properly
borderPane.applyCss();
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/dockfx/DockTitleBar.java
Expand Up @@ -92,7 +92,6 @@ public void handle(ActionEvent event) {

closeButton = new Button();
closeButton.setOnAction(new EventHandler<ActionEvent>() {

@Override
public void handle(ActionEvent event) {
dockNode.close();
Expand All @@ -115,7 +114,6 @@ public void handle(ActionEvent event) {
closeButton.getStyleClass().add("dock-close-button");
stateButton.getStyleClass().add("dock-state-button");
this.getStyleClass().add("dock-title-bar");

}

/**
Expand Down

0 comments on commit e66e091

Please sign in to comment.