Changeset 16438 in josm for trunk/src/org/openstreetmap/josm/gui/MenuScroller.java
- Timestamp:
- 2020-05-17T14:18:22+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MenuScroller.java
r14173 r16438 306 306 if (menuItems != null && menuItems.length > 0) { 307 307 308 int allItemsHeight = 0; 309 for (Component item : menuItems) { 310 allItemsHeight += item.getPreferredSize().height; 311 } 312 308 int allItemsHeight = Arrays.stream(menuItems).mapToInt(item -> item.getPreferredSize().height).sum(); 313 309 int allowedHeight = WindowGeometry.getMaxDimensionOnScreen(menu).height - MainApplication.getMainFrame().getInsets().top; 314 315 boolean mustSCroll = allItemsHeight > allowedHeight; 316 317 if (mustSCroll) { 310 boolean mustScroll = allItemsHeight > allowedHeight; 311 if (mustScroll) { 318 312 firstIndex = Math.min(menuItems.length-1, Math.max(topFixedCount, firstIndex)); 319 313 int scrollCount = computeScrollCount(firstIndex);
Note:
See TracChangeset
for help on using the changeset viewer.