Changeset 14425 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2018-11-16T09:35:34+01:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java
r13265 r14425 64 64 65 65 this.add(mSpltPane); 66 reconstruct(Action. ELEMENT_SHRINKS, null);66 reconstruct(Action.RESTORE_SAVED, null); 67 67 } 68 68 … … 127 127 */ 128 128 COLLAPSED_TO_DEFAULT, 129 /** 130 * Restore saved heights. 131 */ 132 RESTORE_SAVED, 129 133 /* INVISIBLE_TO_COLLAPSED, does not happen */ 130 134 /** … … 187 191 * Determine the panel geometry 188 192 */ 189 if (action == Action.ELEMENT_SHRINKS) { 193 if (action == Action.RESTORE_SAVED) { 194 for (int i = 0; i < n; ++i) { 195 final ToggleDialog dlg = allDialogs.get(i); 196 if (dlg.isDialogInDefaultView()) { 197 final int ph = dlg.getLastHeight(); 198 final int ah = dlg.getSize().height; 199 dlg.setPreferredSize(new Dimension(Integer.MAX_VALUE, ah < 20 ? ph : ah)); 200 } 201 } 202 203 } else if (action == Action.ELEMENT_SHRINKS) { 190 204 for (int i = 0; i < n; ++i) { 191 205 final ToggleDialog dlg = allDialogs.get(i); … … 237 251 triggeredBy.setPreferredSize(new Dimension(Integer.MAX_VALUE, hnTrig)); 238 252 239 /** This is remaini g for the other default view dialogs */253 /** This is remaining for the other default view dialogs */ 240 254 final int r = s2 - hnTrig; 241 255 -
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r14397 r14425 240 240 /** Override any minimum sizes of child elements so the user can resize freely */ 241 241 setMinimumSize(new Dimension(0, 0)); 242 this.preferredHeight = preferredHeight;242 this.preferredHeight = Config.getPref().getInt(preferencePrefix+".preferredHeight", preferredHeight); 243 243 toggleAction = new ToggleDialogAction(name, "dialogs/"+iconName, tooltip, shortcut, helpTopic()); 244 244 … … 457 457 @Override 458 458 public void destroy() { 459 rememberHeight(); 459 460 closeDetachedDialog(); 460 461 if (isShowing) { … … 997 998 stateChanged(); 998 999 } 1000 1001 /** 1002 * @return the last used height stored in preferences or preferredHeight 1003 */ 1004 public int getLastHeight() { 1005 return Config.getPref().getInt(preferencePrefix+".lastHeight", preferredHeight); 1006 } 1007 1008 /** 1009 * Store the current height in preferences so that we can restore it. 1010 */ 1011 public void rememberHeight() { 1012 int h = getHeight(); 1013 Config.getPref().put(preferencePrefix+".lastHeight", Integer.toString(h)); 1014 } 999 1015 }
Note:
See TracChangeset
for help on using the changeset viewer.