Changeset 6098 in josm for trunk/src


Ignore:
Timestamp:
2013-08-02T07:00:57+02:00 (11 years ago)
Author:
akks
Message:

see #6355: do not create "Imagery/More" submenu if there is enough space on screen

File:
1 edited

Legend:

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

    r6097 r6098  
    164164
    165165        addDynamicSeparator();
    166         addDynamic(Main.main.menu.imagerySubMenu);
     166        JMenu subMenu = Main.main.menu.imagerySubMenu;
     167        int heightUnrolled = 30*(getItemCount()+subMenu.getItemCount());
     168        if (heightUnrolled < Main.panel.getHeight()) {
     169            // add all items of submenu if they will fit on screen
     170            int n = subMenu.getItemCount();
     171            for (int i=0; i<n; i++) {
     172                addDynamic(subMenu.getItem(i).getAction());
     173            }
     174        } else {
     175            // or add the submenu itself
     176            addDynamic(subMenu);
     177        }
    167178    }
    168179
Note: See TracChangeset for help on using the changeset viewer.