Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1619 JavaFX Windows Restore to Previous Size/Location On View Request #1728

Merged
merged 1 commit into from Nov 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 18 additions & 22 deletions src/main/java/io/github/dsheirer/gui/JavaFxWindowManager.java
Expand Up @@ -244,9 +244,7 @@ public void process(final JmbeEditorRequest request)
else
{
execute(() -> {
getJmbeEditorStage().show();
getJmbeEditorStage().requestFocus();
getJmbeEditorStage().toFront();
restoreStage(getJmbeEditorStage());
getJmbeEditor().process(request);
});
}
Expand Down Expand Up @@ -317,9 +315,7 @@ public void process(PlaylistEditorRequest request)
execute(() -> {
try
{
getPlaylistStage().show();
getPlaylistStage().requestFocus();
getPlaylistStage().toFront();
restoreStage(getPlaylistStage());
getPlaylistEditor().process(request);
}
catch(Throwable t)
Expand Down Expand Up @@ -367,9 +363,7 @@ private Stage getUserPreferencesStage()
public void process(final ViewUserPreferenceEditorRequest request)
{
execute(() -> {
getUserPreferencesStage().show();
getUserPreferencesStage().requestFocus();
getUserPreferencesStage().toFront();
restoreStage(getUserPreferencesStage());
getUserPreferencesEditor().process(request);
});
}
Expand Down Expand Up @@ -408,11 +402,7 @@ private Stage getChannelMapStage()
@Subscribe
public void process(final ViewIconManagerRequest request)
{
execute(() -> {
getIconManagerStage().show();
getIconManagerStage().requestFocus();
getIconManagerStage().toFront();
});
execute(() -> restoreStage(getIconManagerStage()));
}

/**
Expand All @@ -422,9 +412,7 @@ public void process(final ViewIconManagerRequest request)
public void process(final ViewChannelMapEditorRequest request)
{
execute(() -> {
getChannelMapStage().show();
getChannelMapStage().requestFocus();
getChannelMapStage().toFront();
restoreStage(getChannelMapStage());
getChannelMapEditor().process(request);
});
}
Expand All @@ -435,11 +423,19 @@ public void process(final ViewChannelMapEditorRequest request)
@Subscribe
public void process(final ViewRecordingViewerRequest request)
{
execute(() -> {
getRecordingViewerStage().show();
getRecordingViewerStage().requestFocus();
getRecordingViewerStage().toFront();
});
execute(() -> restoreStage(getRecordingViewerStage()));
}

/**
* Restores the stage to previous size and location.
* @param stage to restore.
*/
private void restoreStage(Stage stage)
{
stage.setIconified(false);
stage.show();
stage.requestFocus();
stage.toFront();
}

@Override
Expand Down