Changeset 15705 in josm for trunk


Ignore:
Timestamp:
2020-01-13T23:37:49+01:00 (5 years ago)
Author:
GerdP
Message:

fix #17654: Notify users of viewport following activation
Show notification when viewport following mode was activated / deactivated with shortcut

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/ViewportFollowToggleAction.java

    r15599 r15705  
    99
    1010import org.openstreetmap.josm.actions.mapmode.DrawAction;
     11import org.openstreetmap.josm.gui.Notification;
     12import org.openstreetmap.josm.gui.util.GuiHelper;
    1113import org.openstreetmap.josm.tools.Shortcut;
    1214
     
    3739        toggleSelectedState(e);
    3840        DrawAction.VIEWPORT_FOLLOWING.put(isSelected());
     41        if (!getShortcut().getKeyText().isEmpty()) {
     42            String msg = isSelected()
     43                    ? tr("Viewport following is enabled, press {0} to disable it", getShortcut().getKeyText())
     44                    : tr("Viewport following is disabled");
     45            GuiHelper.runInEDT(() -> new Notification(msg).show());
     46        }
    3947        notifySelectedState();
    4048    }
Note: See TracChangeset for help on using the changeset viewer.