Changeset 16615 in josm


Ignore:
Timestamp:
2020-06-14T11:01:43+02:00 (4 months ago)
Author:
simon04
Message:

fix #19376 - Offer an option to disable the imagery layer popup menu

To disable, set imagery.generic.popupmenu to false in advanced preferences.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r16553 r16615  
    8888import org.openstreetmap.josm.data.imagery.TileLoaderFactory;
    8989import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
     90import org.openstreetmap.josm.data.preferences.BooleanProperty;
    9091import org.openstreetmap.josm.data.preferences.IntegerProperty;
    9192import org.openstreetmap.josm.data.projection.Projection;
     
    175176            PlatformManager.getPlatform().isHighDpiDisplay() ? 2 : 0);
    176177
     178    private static final BooleanProperty POPUP_MENU_ENABLED = new BooleanProperty(PREFERENCE_PREFIX + ".popupmenu", true);
     179
    177180    /*
    178181     *  use MemoryTileCache instead of tileLoader JCS cache, as tileLoader caches only content (byte[] of image)
     
    195198            if (e.getButton() == MouseEvent.BUTTON3) {
    196199                Component component = e.getComponent();
    197                 if (component.isShowing()) {
     200                if (POPUP_MENU_ENABLED.get() && component.isShowing()) {
    198201                    new TileSourceLayerPopup(e.getX(), e.getY()).show(component, e.getX(), e.getY());
    199202                }
Note: See TracChangeset for help on using the changeset viewer.