diff --git a/src/org/openstreetmap/josm/gui/IconToggleButton.java b/src/org/openstreetmap/josm/gui/IconToggleButton.java
index 08a37ba..3b564ca 100644
|
a
|
b
|
public class IconToggleButton extends JToggleButton implements HideableButton, P
|
| 25 | 25 | public boolean groupbutton; |
| 26 | 26 | private ShowHideButtonListener listener; |
| 27 | 27 | private boolean hideIfDisabled=false; |
| | 28 | private boolean hiddenByDefault; |
| 28 | 29 | |
| 29 | 30 | /** |
| 30 | 31 | * Construct the toggle button with the given action. |
| 31 | 32 | */ |
| 32 | 33 | public IconToggleButton(Action action) { |
| | 34 | this(action, false); |
| | 35 | } |
| | 36 | |
| | 37 | /** |
| | 38 | * Construct the toggle button with the given action. |
| | 39 | */ |
| | 40 | public IconToggleButton(Action action, boolean hiddenByDefault) { |
| 33 | 41 | super(action); |
| | 42 | this.hiddenByDefault = hiddenByDefault; |
| 34 | 43 | setText(null); |
| 35 | 44 | |
| 36 | 45 | Object o = action.getValue(Action.SHORT_DESCRIPTION); |
| … |
… |
public class IconToggleButton extends JToggleButton implements HideableButton, P
|
| 78 | 87 | @Override |
| 79 | 88 | public void applyButtonHiddenPreferences() { |
| 80 | 89 | boolean alwaysHideDisabled = Main.pref.getBoolean("sidetoolbar.hideDisabledButtons", false); |
| 81 | | boolean hiddenFlag = Main.pref.getBoolean(getPreferenceKey(), false); |
| | 90 | boolean hiddenFlag = Main.pref.getBoolean(getPreferenceKey(), hiddenByDefault); |
| 82 | 91 | if (!isEnabled() && (hideIfDisabled || alwaysHideDisabled)) |
| 83 | 92 | setVisible(false); // hide because of disabled button |
| 84 | 93 | else |
diff --git a/src/org/openstreetmap/josm/gui/MapFrame.java b/src/org/openstreetmap/josm/gui/MapFrame.java
index b6019d2..a0de622 100644
|
a
|
b
|
public class MapFrame extends JPanel implements Destroyable, LayerChangeListener
|
| 144 | 144 | addMapMode(new IconToggleButton(new SelectAction(this))); |
| 145 | 145 | addMapMode(new IconToggleButton(new DrawAction(this))); |
| 146 | 146 | addMapMode(new IconToggleButton(new ZoomAction(this))); |
| 147 | | addMapMode(new IconToggleButton(new DeleteAction(this))); |
| 148 | | addMapMode(new IconToggleButton(new ExtrudeAction(this))); |
| 149 | | addMapMode(new IconToggleButton(new ParallelWayAction(this))); |
| | 147 | addMapMode(new IconToggleButton(new DeleteAction(this), !Main.pref.getBoolean("expert", false))); |
| | 148 | addMapMode(new IconToggleButton(new ExtrudeAction(this), !Main.pref.getBoolean("expert", false))); |
| | 149 | addMapMode(new IconToggleButton(new ParallelWayAction(this), !Main.pref.getBoolean("expert", false))); |
| 150 | 150 | |
| 151 | 151 | toolGroup.setSelected(((AbstractButton)toolBarActions.getComponent(0)).getModel(), true); |
| 152 | 152 | |