Changeset 8982 in josm


Ignore:
Timestamp:
2015-11-02T21:33:21+01:00 (4 years ago)
Author:
simon04
Message:

fix #11859 - Presets cut off on small screens

Add a menu scroller for long preset groups, i.e., having 15 or more elements,
can be changed with preference key taggingpreset.min-elements-for-scroller.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java

    r8863 r8982  
    1212
    1313import org.openstreetmap.josm.Main;
     14import org.openstreetmap.josm.gui.MenuScroller;
    1415import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager;
    1516
     
    7374                }
    7475            }
     76            for (JMenu submenu : submenus.values()) {
     77                if (submenu.getItemCount() >= Main.pref.getInteger("taggingpreset.min-elements-for-scroller", 15)) {
     78                    MenuScroller.setScrollerFor(submenu);
     79                }
     80            }
    7581        }
    7682        if (Main.pref.getBoolean("taggingpreset.sortmenu")) {
Note: See TracChangeset for help on using the changeset viewer.