Skip to content

Commit e8e303e

Browse files
committed
Versions: fixed poll date persistency and text position of the release content
1 parent e770f36 commit e8e303e

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

app/src/main/java/org/audiveris/omr/sheet/Versions.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151

5252
import java.awt.Color;
5353
import java.awt.Insets;
54+
import java.awt.Point;
5455
import java.awt.event.ActionEvent;
5556
import java.net.URL;
5657
import java.text.DateFormat;
@@ -355,6 +356,12 @@ public static void poll (boolean manual)
355356
JOptionPane.INFORMATION_MESSAGE);
356357
}
357358
}
359+
360+
if (!manual) {
361+
// Remember the date this poll was made
362+
final Calendar now = new GregorianCalendar();
363+
constants.lastReleaseCheckDate.setValue(now.getTime());
364+
}
358365
}
359366

360367
//~ Inner Classes ------------------------------------------------------------------------------
@@ -586,6 +593,11 @@ private static class PositivePanel
586593
scrollPane.setViewportView(contentField);
587594

588595
defineLayout();
596+
597+
// Trick to pre-position the scroll pane at its top left
598+
javax.swing.SwingUtilities.invokeLater( () -> {
599+
scrollPane.getViewport().setViewPosition(new Point(0, 0));
600+
});
589601
}
590602

591603
private void defineLayout ()
@@ -636,18 +648,5 @@ private String htmlOf (String markdown)
636648

637649
return renderer.render(parser.parse(markdown));
638650
}
639-
640-
@Override
641-
public void setVisible (boolean visible)
642-
{
643-
super.setVisible(visible);
644-
645-
if (visible == true) {
646-
scrollPane.getVerticalScrollBar().setValue(0); // scroll bar to the top
647-
scrollPane.getHorizontalScrollBar().setValue(0); // scroll bar to the left
648-
}
649-
650-
scrollPane.repaint();
651-
}
652651
}
653652
}

0 commit comments

Comments
 (0)