Changeset 9006 in josm
- Timestamp:
- 2015-11-15T01:43:19+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DialogsToggleAction.java
r8510 r9006 57 57 Main.map.setDialogsPanelVisible(selected); 58 58 Main.map.statusLine.setVisible(selected || Main.pref.getBoolean("statusbar.always-visible", true)); 59 Main.toolbar.control.setVisible(selected || Main.pref.getBoolean("toolbar.always-visible", true));60 59 Main.main.menu.setVisible(selected || Main.pref.getBoolean("menu.always-visible", true)); 61 // sideToolBar listens to preference changes, use it here 60 // Toolbars listen to preference changes, use it here 61 if (!Main.pref.getBoolean("toolbar.always-visible", true)) { 62 Main.pref.put("toolbar.visible", selected); 63 } 62 64 if (!Main.pref.getBoolean("sidetoolbar.always-visible", true)) { 63 65 Main.pref.put("sidetoolbar.visible", selected); -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r8958 r9006 741 741 add(viewMenu, historyinfoweb); 742 742 viewMenu.addSeparator(); 743 viewMenu.add(new PreferenceToggleAction(tr("Main toolbar"), 744 tr("Toggles the visibility of the main toolbar (i.e., the horizontal toolbar)"), 745 "toolbar.visible", true).getCheckbox()); 743 746 viewMenu.add(new PreferenceToggleAction(tr("Edit toolbar"), 744 747 tr("Toggles the visibility of the edit toolbar (i.e., the vertical tool)"), -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r8863 r9006 69 69 import org.openstreetmap.josm.actions.ParameterizedAction; 70 70 import org.openstreetmap.josm.actions.ParameterizedActionDecorator; 71 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent; 72 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener; 71 73 import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset; 72 74 import org.openstreetmap.josm.tools.GBC; … … 483 485 private final DefaultMutableTreeNode rootActionsNode = new DefaultMutableTreeNode(tr("Actions")); 484 486 485 public JToolBar control = new JToolBar();487 public final JToolBar control = new JToolBar(); 486 488 private final Map<Object, ActionDefinition> buttonActions = new ConcurrentHashMap<>(30); 487 489 … … 900 902 control.setFloatable(false); 901 903 control.setComponentPopupMenu(popupMenu); 904 Main.pref.addPreferenceChangeListener(new PreferenceChangedListener() { 905 @Override 906 public void preferenceChanged(PreferenceChangeEvent e) { 907 if ("toolbar.visible".equals(e.getKey())) { 908 refreshToolbarControl(); 909 } 910 } 911 }); 902 912 } 903 913 … … 1065 1075 } 1066 1076 } 1077 1078 boolean visible = Main.pref.getBoolean("toolbar.visible", true); 1079 1067 1080 control.setFocusTraversalKeysEnabled(!unregisterTab); 1068 control.setVisible( control.getComponentCount() != 0);1081 control.setVisible(visible && control.getComponentCount() != 0); 1069 1082 control.repaint(); 1070 1083 }
Note:
See TracChangeset
for help on using the changeset viewer.