Changeset 5092 in josm for trunk/src/org
- Timestamp:
- 2012-03-16T22:36:45+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r5089 r5092 91 91 import org.openstreetmap.josm.actions.ZoomOutAction; 92 92 import org.openstreetmap.josm.actions.OrthogonalizeAction.Undo; 93 import org.openstreetmap.josm.actions.PreferenceToggleAction; 93 94 import org.openstreetmap.josm.actions.audio.AudioBackAction; 94 95 import org.openstreetmap.josm.actions.audio.AudioFasterAction; … … 515 516 add(viewMenu, historyinfoweb); 516 517 viewMenu.addSeparator(); 518 viewMenu.add(new PreferenceToggleAction(tr("Edit toolbar"), 519 tr("Toggles the visibility of the edit toolbar (i.e., the vertical tool)"), 520 "sidetoolbar.visible", true).getCheckbox()); 517 521 // -- expert mode toggle action 518 522 final JCheckBoxMenuItem expertItem = new JCheckBoxMenuItem(ExpertToggleAction.getInstance()); -
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r5091 r5092 49 49 import org.openstreetmap.josm.actions.mapmode.SelectAction; 50 50 import org.openstreetmap.josm.actions.mapmode.ZoomAction; 51 import org.openstreetmap.josm.data.Preferences; 52 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent; 51 53 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 52 54 import org.openstreetmap.josm.gui.dialogs.ChangesetDialog; … … 397 399 } 398 400 399 if(Main.pref.getBoolean("sidetoolbar.visible", true)) 400 { 401 if(Main.pref.getBoolean("sidetoolbar.scrollable", true)) { 402 final ScrollViewport svp = new ScrollViewport(jb, ScrollViewport.VERTICAL_DIRECTION); 403 panel.add(svp, BorderLayout.WEST); 404 jb.addMouseWheelListener(new MouseWheelListener() { 405 public void mouseWheelMoved(MouseWheelEvent e) { 406 svp.scroll(0,e.getUnitsToScroll() * 5); 401 final Component toToggle; 402 if (Main.pref.getBoolean("sidetoolbar.scrollable", true)) { 403 final ScrollViewport svp = new ScrollViewport(jb, ScrollViewport.VERTICAL_DIRECTION); 404 toToggle = svp; 405 panel.add(svp, BorderLayout.WEST); 406 jb.addMouseWheelListener(new MouseWheelListener() { 407 408 public void mouseWheelMoved(MouseWheelEvent e) { 409 svp.scroll(0, e.getUnitsToScroll() * 5); 410 } 411 }); 412 } else { 413 toToggle = jb; 414 panel.add(jb, BorderLayout.WEST); 415 } 416 toToggle.setVisible(Main.pref.getBoolean("sidetoolbar.visible", true)); 417 418 jb.addMouseListener(new PopupMenuLauncher(new JPopupMenu() { 419 420 { 421 add(new AbstractAction(tr("Hide edit toolbar")) { 422 423 @Override 424 public void actionPerformed(ActionEvent e) { 425 Main.pref.put("sidetoolbar.visible", false); 407 426 } 408 427 }); 409 } else { 410 panel.add(jb, BorderLayout.WEST); 411 } 412 } 428 } 429 })); 430 431 Main.pref.addPreferenceChangeListener(new Preferences.PreferenceChangedListener() { 432 433 @Override 434 public void preferenceChanged(PreferenceChangeEvent e) { 435 if ("sidetoolbar.visible".equals(e.getKey())) { 436 toToggle.setVisible(Main.pref.getBoolean("sidetoolbar.visible")); 437 } 438 } 439 }); 440 413 441 if (statusLine != null && Main.pref.getBoolean("statusline.visible", true)) { 414 442 panel.add(statusLine, BorderLayout.SOUTH);
Note:
See TracChangeset
for help on using the changeset viewer.