Changeset 17265 in josm for trunk/src/org


Ignore:
Timestamp:
2020-10-25T17:07:27+01:00 (4 years ago)
Author:
GerdP
Message:

see #7548: Re-organize the preference dialog
Apply 7548-no-empty.patch to avoid empty top panel

  • make sure that a panel is selected when selectPreviouslySelectedPreferences() is called and nothing was previously selected
  • reverts r17097
Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/PreferencesAction.java

    r17188 r17265  
    77import java.awt.event.ActionEvent;
    88import java.awt.event.KeyEvent;
    9 
    10 import javax.swing.SwingUtilities;
    119
    1210import org.openstreetmap.josm.gui.MainApplication;
     
    108106    public void run() {
    109107        final PreferenceDialog p = new PreferenceDialog(MainApplication.getMainFrame());
    110         SwingUtilities.invokeLater(() -> {
    111             if (tab != null) {
    112                 p.selectPreferencesTabByClass(tab);
    113             } else if (subTab != null) {
    114                 p.selectSubPreferencesTabByClass(subTab);
    115             } else {
    116                 p.selectPreviouslySelectedPreferences();
    117             }
    118         });
     108        if (tab != null) {
     109            p.selectPreferencesTabByClass(tab);
     110        } else if (subTab != null) {
     111            p.selectSubPreferencesTabByClass(subTab);
     112        } else {
     113            p.selectPreviouslySelectedPreferences();
     114        }
    119115        p.setVisible(true);
    120116    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java

    r17228 r17265  
    154154        } else if (previouslySelected != null && previouslySelected.a != null) {
    155155            tpPreferences.selectTabByPref(previouslySelected.a);
     156        } else {
     157            tpPreferences.setSelectedIndex(0);
    156158        }
    157159    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

    r17264 r17265  
    559559            }
    560560        }
     561        setSelectedIndex(-1);
    561562    }
    562563
Note: See TracChangeset for help on using the changeset viewer.