Changeset 4835 in josm
- Timestamp:
- 2012-01-21T14:04:36+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/IconToggleButton.java
r4669 r4835 26 26 private ShowHideButtonListener listener; 27 27 private boolean hideIfDisabled=false; 28 private boolean hiddenByDefault; 28 29 29 30 /** … … 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 … … 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 -
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r4669 r4835 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);
Note:
See TracChangeset
for help on using the changeset viewer.