Ignore:
Timestamp:
29.08.2009 15:51:00 (3 years ago)
Author:
Gubaer
Message:

fixed #2367: panel will be empty when undocked from minimized state
cleanup in Toggle Dialog
new: toggle dialog remember position when detached
new: title in toggle dialog
NOTE: this changeset probably breaks plugins, in particular the validator plugin

File:
1 edited

Legend:

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

    r1890 r2005  
    7070     * instead of adding directly to this list. 
    7171     */ 
    72     public JPanel toggleDialogs = new JPanel(); 
    73     public ArrayList<ToggleDialog> allDialogs = new ArrayList<ToggleDialog>(); 
     72    private JPanel toggleDialogs = new JPanel(); 
     73    private ArrayList<ToggleDialog> allDialogs = new ArrayList<ToggleDialog>(); 
    7474 
    7575    public final ButtonGroup toolGroup = new ButtonGroup(); 
     
    135135    public void destroy() { 
    136136        for (ToggleDialog t : allDialogs) { 
    137             t.close(); 
     137            t.closeDetachedDialog(); 
    138138        } 
    139139        for (int i = 0; i < toolBarActions.getComponentCount(); ++i) 
     
    167167        for (Component c : toggleDialogs.getComponents()) { 
    168168            if (c instanceof ToggleDialog) { 
    169                 boolean sel = Main.pref.getBoolean(((ToggleDialog)c).prefName+".visible"); 
    170                 ((ToggleDialog)c).action.button.setSelected(sel); 
    171                 c.setVisible(sel); 
     169                ToggleDialog td = (ToggleDialog)c; 
     170                if (Main.pref.getBoolean(td.getPreferencePrefix()+".visible")) { 
     171                    td.showDialog(); 
     172                } 
    172173            } 
    173174        } 
     
    179180     */ 
    180181    public IconToggleButton addToggleDialog(ToggleDialog dlg) { 
    181         IconToggleButton button = new IconToggleButton(dlg.action); 
    182         dlg.action.button = button; 
    183         dlg.parent = toggleDialogs; 
     182        IconToggleButton button = new IconToggleButton(dlg.getToggleAction()); 
     183        dlg.setParent(toggleDialogs); 
    184184        toolBarToggle.add(button); 
    185185        toggleDialogs.add(dlg); 
Note: See TracChangeset for help on using the changeset viewer.