Changeset 17298 in josm


Ignore:
Timestamp:
2020-11-06T07:14:35+01:00 (4 years ago)
Author:
simon04
Message:

see #7548 - Re-organize the preference dialog (Look and Feel as subtab in display preferences)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java

    r17293 r17298  
    1616import javax.swing.JLabel;
    1717import javax.swing.JList;
     18import javax.swing.JScrollPane;
    1819import javax.swing.JSeparator;
    1920import javax.swing.JSpinner;
     
    3031import org.openstreetmap.josm.gui.NavigatableComponent;
    3132import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
    32 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
     33
    3334import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
    3435import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
    3536import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     37import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting;
     38import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting;
    3639import org.openstreetmap.josm.gui.widgets.FileChooserManager;
    3740import org.openstreetmap.josm.gui.widgets.JosmComboBox;
     
    4649 * Look-and-feel preferences.
    4750 */
    48 public class LafPreference extends DefaultTabPreferenceSetting {
     51public class LafPreference implements SubPreferenceSetting {
    4952
    5053    /**
     
    7275            return new LafPreference();
    7376        }
    74     }
    75 
    76     LafPreference() {
    77         super(/* ICON(preferences/) */ "display", tr("Look and Feel"), tr("Change the Look and Feel of the program"));
    7877    }
    7978
     
    218217        panel.add(spinZoomRatio, GBC.eol());
    219218
    220         panel.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.BOTH));
    221 
    222         createPreferenceTabWithScrollPane(gui, panel);
     219        JScrollPane scrollpane = panel.getVerticalScrollPane();
     220        scrollpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
     221        gui.getDisplayPreference().addSubTab(this, tr("Look and Feel"), scrollpane);
    223222    }
    224223
     
    248247    }
    249248
     249    @Override
     250    public TabPreferenceSetting getTabPreferenceSetting(final PreferenceTabbedPane gui) {
     251        return gui.getDisplayPreference();
     252    }
     253
    250254}
Note: See TracChangeset for help on using the changeset viewer.