Changeset 16457 in josm


Ignore:
Timestamp:
2020-05-17T22:19:49+02:00 (5 years ago)
Author:
simon04
Message:

History/VersionTable: scroll active versions into view

Before, the table was showing the first versions. For objects with many versions, one had to scroll down to find the diffed versions (active radio buttons).

File:
1 edited

Legend:

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

    r16395 r16457  
    1515import java.awt.event.MouseEvent;
    1616import java.util.Objects;
     17import java.util.stream.IntStream;
    1718
    1819import javax.swing.DefaultCellEditor;
     
    9697            }
    9798        });
     99        getModel().addTableModelListener(e ->
     100                IntStream.range(0, model.getHistory().getNumVersions()).filter(model::isCurrentPointInTime).findFirst().ifPresent(row ->
     101                        scrollRectToVisible(getCellRect(row, 0, true))));
    98102        getModel().addTableModelListener(e -> {
    99103            adjustColumnWidth(this, 0, 0);
Note: See TracChangeset for help on using the changeset viewer.