Changeset 4248 in josm for trunk/src/org
- Timestamp:
- 2011-07-15T19:07:53+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java
r3855 r4248 9 9 import java.awt.Dimension; 10 10 import java.awt.FlowLayout; 11 import java.awt.Insets; 12 import java.awt.Toolkit; 11 13 import java.awt.event.ActionEvent; 12 14 import java.awt.event.KeyEvent; … … 61 63 super(JOptionPane.getFrameForComponent(parent), tr("Preferences"), ModalityType.DOCUMENT_MODAL); 62 64 build(); 65 this.setMinimumSize(new Dimension(600, 350)); 66 // set the maximum width to the current screen. If the dialog is opened on a 67 // smaller screen than before, this will reset the stored preference. 68 this.setMaximumSize( Toolkit.getDefaultToolkit().getScreenSize()); 63 69 } 64 70 … … 74 80 public void setVisible(boolean visible) { 75 81 if (visible) { 82 // Make the pref window at most as large as the parent JOSM window 83 // Have to take window decorations into account or the windows will 84 // be too large 85 Insets i = this.getParent().getInsets(); 86 Dimension p = this.getParent().getSize(); 87 p = new Dimension(Math.min(p.width-i.left-i.right, 700), 88 Math.min(p.height-i.top-i.bottom, 800)); 76 89 new WindowGeometry( 77 90 getClass().getName() + ".geometry", 78 91 WindowGeometry.centerInWindow( 79 92 getParent(), 80 new Dimension(700,800)93 p 81 94 ) 82 95 ).applySafe(this);
Note:
See TracChangeset
for help on using the changeset viewer.