mirror of
https://github.com/processing/processing4.git
synced 2026-02-10 17:19:25 +01:00
save tab pane location, make windows height narrower for prettiness
This commit is contained in:
@@ -192,13 +192,19 @@ public class PdeEditor extends JPanel {
|
||||
|
||||
splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
|
||||
textarea, consolePanel);
|
||||
|
||||
|
||||
splitPane.setOneTouchExpandable(true);
|
||||
// repaint child panes while resizing
|
||||
splitPane.setContinuousLayout(true);
|
||||
// if window increases in size, give all of increase to textarea (top pane)
|
||||
splitPane.setResizeWeight(1D);
|
||||
|
||||
// the default size on windows is too small and kinda ugly
|
||||
int dividerSize = PdeBase.getInteger("editor.divider.size", 0);
|
||||
if (dividerSize != 0) {
|
||||
splitPane.setDividerSize(dividerSize);
|
||||
}
|
||||
|
||||
rightPanel.add(splitPane, BorderLayout.CENTER);
|
||||
|
||||
// end swing version from danh
|
||||
@@ -401,6 +407,14 @@ public class PdeEditor extends JPanel {
|
||||
String what = path + File.separator + name + ".pde";
|
||||
//System.out.println(what);
|
||||
|
||||
if (windowX != -1) {
|
||||
String dividerLocation =
|
||||
skprops.getProperty("editor.divider.location");
|
||||
if (dividerLocation != null) {
|
||||
splitPane.setDividerLocation(Integer.parseInt(dividerLocation));
|
||||
}
|
||||
}
|
||||
|
||||
if (new File(what).exists()) {
|
||||
userName = user;
|
||||
skOpen(path, name);
|
||||
@@ -1740,6 +1754,8 @@ afterwards, some of these steps need a cleanup function
|
||||
skprops.put("user.name", userName);
|
||||
|
||||
skprops.put("editor.external", externalEditor ? "true" : "false");
|
||||
skprops.put("editor.divider.location",
|
||||
String.valueOf(splitPane.getDividerLocation()));
|
||||
|
||||
skprops.put("serial.port", PdeBase.get("serial.port", "unspecified"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user