diff --git a/CHANGELOG.md b/CHANGELOG.md index 08747ed..933ffc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.4.1 +- Reinstate (but deprecate) previous methods to add close shortcuts to stages (https://github.com/qupath/qupath-fxtras/issues/73) + ## v0.4.0 - Use Java and JavaFX 21 - Improved `InputDisplay` javadocs, new property to reverse scrolling (https://github.com/qupath/qupath-fxtras/pull/70) diff --git a/build.gradle.kts b/build.gradle.kts index b80c441..42357d2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { base { group = "io.github.qupath" - version = "0.4.0" + version = "0.4.1" description = "Extra classes built on JavaFX that are used to help create the QuPath user interface. " + "These don't depend on other QuPath modules, so can be reused elsewhere." } diff --git a/src/main/java/qupath/fx/utils/FXUtils.java b/src/main/java/qupath/fx/utils/FXUtils.java index 3f783f0..f84965f 100644 --- a/src/main/java/qupath/fx/utils/FXUtils.java +++ b/src/main/java/qupath/fx/utils/FXUtils.java @@ -612,11 +612,33 @@ public static void simplifyTitledPane(TitledPane pane, boolean boldTitle) { } } + /** + * Add shortcuts to close a stage using the standard shortcuts (Shortcut+W, Esc). + * @param stage + * @deprecated use {@link #addCloseWindowShortcuts(Window)} + */ + @Deprecated + public static void addCloseWindowShortcuts(Stage stage) { + addCloseWindowShortcuts((Window)stage); + } + + /** + * Add shortcuts to close a stage using the specified key combinations. + * @param stage + * @param keyCombinations + * @deprecated use {@link #addCloseWindowShortcuts(Window, Collection)} + */ + @Deprecated + public static void addCloseWindowShortcuts(Stage stage, Collection keyCombinations) { + addCloseWindowShortcuts((Window)stage, keyCombinations); + } + /** * Add shortcuts to close a window using the standard shortcuts (Shortcut+W, Esc). * @param window * @see #addCloseWindowShortcuts(Window, Collection) + * @since v0.4.0 */ public static void addCloseWindowShortcuts(Window window) { addCloseWindowShortcuts(window, Arrays.asList( @@ -632,6 +654,7 @@ public static void addCloseWindowShortcuts(Window window) { * @param keyCombinations * @see #addCloseWindowShortcuts(Window) * @implSpec this only fires a window close request; any handler may still choose to consume the event quietly + * @since v0.4.0 */ public static void addCloseWindowShortcuts(Window window, Collection keyCombinations) { if (keyCombinations.isEmpty()) {