Merge pull request #1867 from SiboVG/close-photostudio

Close PhotoStudio when parent window closes
This commit is contained in:
Sibo Van Gool 2022-12-01 21:25:33 +01:00 committed by GitHub
commit e19deecf94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,6 +69,14 @@ public class PhotoFrame extends JFrame {
public PhotoFrame(OpenRocketDocument document, Window parent) {
this(false, document);
setTitle(trans.get("PhotoFrame.title") + " - " + document.getRocket().getName());
// Close this window when the parent is closed
parent.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
dispose();
}
});
}
public PhotoFrame(boolean app, OpenRocketDocument document) {