Skip to content

Commit cb8e184

Browse files
committed
Using setMinimumSize() instead of window listener for editor windows.
http://code.google.com/p/arduino/issues/detail?id=52
1 parent 0acebee commit cb8e184

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

app/src/processing/app/Editor.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -288,19 +288,9 @@ public void windowDeactivated(WindowEvent e) {
288288
setPlacement(location);
289289

290290

291-
// If the window is resized too small this will resize it again to the
292-
// minimums. Adapted by Chris Lonnen from comments here:
293-
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4320050
294-
// as a fix for http://dev.processing.org/bugs/show_bug.cgi?id=25
295-
final int minW = Preferences.getInteger("editor.window.width.min");
296-
final int minH = Preferences.getInteger("editor.window.height.min");
297-
addComponentListener(new java.awt.event.ComponentAdapter() {
298-
public void componentResized(ComponentEvent event) {
299-
setSize((getWidth() < minW) ? minW : getWidth(),
300-
(getHeight() < minH) ? minH : getHeight());
301-
}
302-
});
303-
291+
// Set the minimum size for the editor window
292+
setMinimumSize(new Dimension(Preferences.getInteger("editor.window.width.min"),
293+
Preferences.getInteger("editor.window.height.min")));
304294
// System.out.println("t3");
305295

306296
// Bring back the general options for the editor

0 commit comments

Comments
 (0)