Skip to content

Commit

Permalink
Added minimum window height. Fix for #85.
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilfb committed Jun 20, 2016
1 parent 57d643c commit b0f616e
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ public class MqttConnectionController implements Initializable, TabController, P

private static final int SCRIPTED_PUBLICATION_PANE_MIN_EXPANDED_HEIGHT = 136;

final static Logger logger = LoggerFactory.getLogger(MqttConnectionController.class);
private static final double MIN_WINDOW_HIGHT = SUBSCRIPTION_PANE_MIN_EXPANDED_HEIGHT;

private static final double MIN_WINDOW_WIDTH = 300;

private final static Logger logger = LoggerFactory.getLogger(MqttConnectionController.class);

@FXML
private AnchorPane connectionPane;
Expand Down Expand Up @@ -747,8 +751,10 @@ public void handle(WindowEvent event)
status.getController().getTitledPane().setCollapsible(false);
updateMinHeights();

stage.setMinHeight(status.getController().getTitledPane().getMinHeight());
stage.setMinWidth(300);
final double paneMinHeight = status.getController().getTitledPane().getMinHeight();

stage.setMinHeight(paneMinHeight > MIN_WINDOW_HIGHT ? paneMinHeight : MIN_WINDOW_HIGHT);
stage.setMinWidth(MIN_WINDOW_WIDTH);
stage.show();
}
// If set to be shown
Expand Down

0 comments on commit b0f616e

Please sign in to comment.