Ignore:
Timestamp:
2012-12-29T16:07:47+01:00 (11 years ago)
Author:
Don-vip
Message:

see #8024, fix #8012 - Remember position of add/edit tags dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java

    r5638 r5646  
    447447    }
    448448
     449    protected final void rememberWindowGeometry(WindowGeometry geometry) {
     450        if (geometry != null) {
     451            geometry.remember(rememberSizePref);
     452        }
     453    }
     454   
     455    protected final WindowGeometry initWindowGeometry() {
     456        return new WindowGeometry(rememberSizePref, defaultWindowGeometry);
     457    }
     458
    449459    /**
    450460     * Override setVisible to be able to save the window geometry if required
     
    459469        if(rememberSizePref.length() != 0 && defaultWindowGeometry != null) {
    460470            if(visible) {
    461                 new WindowGeometry(rememberSizePref,
    462                         defaultWindowGeometry).applySafe(this);
     471                initWindowGeometry().applySafe(this);
    463472            } else if (isShowing()) { // should fix #6438, #6981, #8295
    464                 new WindowGeometry(this).remember(rememberSizePref);
     473                rememberWindowGeometry(new WindowGeometry(this));
    465474            }
    466475        }
     
    473482
    474483    /**
    475      * Call this if you want the dialog to remember the size set by the user.
     484     * Call this if you want the dialog to remember the geometry (size and position) set by the user.
    476485     * Set the pref to <code>null</code> or to an empty string to disable again.
    477486     * By default, it's disabled.
Note: See TracChangeset for help on using the changeset viewer.