trackeditor: save window position and size

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8310 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: dae107a1489c9d02abac5ac0d6889a3bb0e0243d
Former-commit-id: d8efe8158643d870d7bc956b20ba722ef636b6fa
This commit is contained in:
iobyte 2022-07-10 17:20:55 +00:00
parent d9dd85685b
commit 73fd7df3cc

View file

@ -538,11 +538,8 @@ public class EditorFrame extends JFrame
this.setTitle(title);
Image image = new ImageIcon(getClass().getResource("/icon.png")).getImage();
this.setIconImage(image);
setSize(new Dimension(800, 600));
Point p = new Point();
p.x = getProject().getFrameX();
p.y = getProject().getFrameY();
this.setLocation(p);
setSize(new Dimension(preferences.getInt("Width", 800), preferences.getInt("Height", 600)));
setLocation(new Point(preferences.getInt("X", 0), preferences.getInt("Y", 0)));
menuFile.setText("File");
itemCloseCircuit.setText("Exit");
itemCloseCircuit.addActionListener(new ActionListener()
@ -2081,6 +2078,12 @@ public class EditorFrame extends JFrame
{
getProject().setFrameX(this.getX());
getProject().setFrameY(this.getY());
preferences.putInt("X", this.getX());
preferences.putInt("Y", this.getY());
preferences.putInt("Width", this.getWidth());
preferences.putInt("Height", this.getHeight());
System.exit(0);
}