Skip to content

Commit

Permalink
Closing a register window with CTRL-F4 was not working
Browse files Browse the repository at this point in the history
  • Loading branch information
ccavanaugh committed Mar 31, 2019
1 parent 247d987 commit f52424a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* Write and replace for bxds and xml files to protect against corruption if a crash occurs during a save.
== Release 3.0.2
* 03/31/2019 Closing a register window with CTRL-F4 was not working.
* 03/31/2019 Added a commandline option to bypass the bootloader.
* 03/31/2019 The wrong version information ws being reported on the console when requested.
* 03/30/2019 Automatic column widths will now update correctly if numeric or date formats change.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,21 @@
import javafx.collections.FXCollections;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.input.KeyCode;
import javafx.stage.Screen;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

import jgnash.engine.Account;
import jgnash.engine.AccountGroup;
import jgnash.engine.Transaction;
import jgnash.resource.util.ResourceUtils;
import jgnash.resource.util.Version;
import jgnash.uifx.util.FXMLUtils;
import jgnash.uifx.util.JavaFXUtils;
import jgnash.uifx.util.StageUtils;
import jgnash.uifx.views.main.MainView;
import jgnash.util.NotNull;
import jgnash.resource.util.ResourceUtils;

/**
* A Stage that displays a single account register. Size and position is preserved
Expand Down Expand Up @@ -67,6 +69,13 @@ private RegisterStage(@NotNull final Account account) {

getScene().getStylesheets().addAll(MainView.DEFAULT_CSS);

// handle CTRL-F4
getScene().setOnKeyPressed(event -> {
if (event.isControlDown() && event.getCode() == KeyCode.F4) {
close();
}
});

double minWidth = Double.MAX_VALUE;
double minHeight = Double.MAX_VALUE;

Expand Down Expand Up @@ -117,6 +126,6 @@ public static ListProperty<RegisterStage> registerStageList() {
}

private void updateTitle(final Account account) {
setTitle("jGnash - " + account.getPathName());
setTitle(Version.getAppName() + " - " + account.getPathName());
}
}

0 comments on commit f52424a

Please sign in to comment.