Skip to content

Commit

Permalink
Merge 1bd13b0 into 850a1bb
Browse files Browse the repository at this point in the history
  • Loading branch information
garbanzos committed Apr 6, 2016
2 parents 850a1bb + 1bd13b0 commit 3a6ae5b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/ui/components/pickers/AssigneePickerDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public AssigneePickerDialog(Stage stage, TurboIssue issue, List<TurboUser> users
initUI();
setupKeyEvents();
fillTextFieldWithExistingAssignee();
Platform.runLater(() -> positionDialog(stage));
}

private void fillTextFieldWithExistingAssignee() {
Expand All @@ -60,6 +61,11 @@ private void setupKeyEvents() {
});
}

private final void positionDialog(Stage stage) {
setX(stage.getX() + stage.getWidth() / 2);
setY(stage.getY() + stage.getHeight() / 2 - getHeight() / 2);
}

private void handleUpdatedInput(String userInput) {
state = new AssigneePickerState(originalUsers, userInput);
refreshUI(state);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public MilestonePickerDialog(Stage stage, TurboIssue issue, List<TurboMilestone>
initUI();
setupKeyEvents();
setInputFieldToDefaultMilestone();
Platform.runLater(() -> positionDialog(stage));
}

/**
Expand All @@ -64,6 +65,11 @@ private void fillInputFieldWithMilestoneName(String milestoneName) {
inputField.setText(milestoneName);
}

private final void positionDialog(Stage stage) {
setX(stage.getX() + stage.getWidth() / 2);
setY(stage.getY() + stage.getHeight() / 2 - getHeight() / 2);
}

private void setupKeyEvents() {
inputField.textProperty().addListener((observable, oldValue, newValue) -> {
handleUpdatedInput(newValue);
Expand Down

0 comments on commit 3a6ae5b

Please sign in to comment.