mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 02:45:36 +01:00
Hide sketchbook window before creating a new one
Copy pasted from rebuildExamplesFrame()
This commit is contained in:
@@ -691,11 +691,18 @@ public abstract class Mode {
|
||||
|
||||
/** Sketchbook has changed, update it on next viewing. */
|
||||
public void rebuildSketchbookFrame() {
|
||||
boolean wasVisible =
|
||||
(sketchbookFrame == null) ? false : sketchbookFrame.isVisible();
|
||||
sketchbookFrame = null; // Force a rebuild
|
||||
if (wasVisible) {
|
||||
showSketchbookFrame();
|
||||
if (sketchbookFrame != null) {
|
||||
boolean visible = sketchbookFrame.isVisible();
|
||||
Rectangle bounds = null;
|
||||
if (visible) {
|
||||
bounds = sketchbookFrame.getBounds();
|
||||
sketchbookFrame.setVisible(false);
|
||||
}
|
||||
sketchbookFrame = null;
|
||||
if (visible) {
|
||||
showSketchbookFrame();
|
||||
sketchbookFrame.setBounds(bounds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user