Scroll the selected node in tagtree to visible (bacause when detail panel is shown, sometimes the selected node can be out of the visible area)

This commit is contained in:
honfika@gmail.com
2015-06-22 15:17:19 +02:00
parent c39b23d282
commit b3f5db6032

View File

@@ -2635,9 +2635,25 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
} else {
if (!detailPanel.isVisible()) {
detailPanel.setVisible(true);
new Thread() {
@Override
public void run() {
try {
Thread.sleep(10);
} catch (InterruptedException ex) {
logger.log(Level.SEVERE, null, ex);
}
View.execInEventDispatch(() -> {
tagTree.scrollPathToVisible(tagTree.getSelectionPath());
});
}
}.start();
}
}
}
private void showCard(String card) {
@@ -2829,6 +2845,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
}
public void reload(boolean forceReload) {
tagTree.scrollPathToVisible(tagTree.getSelectionPath());
if (Configuration.dumpView.get()) {
dumpViewReload(forceReload);
return;