Skip to content

Commit

Permalink
Merge pull request #13193 from Pugwash1/20240615-strtpref
Browse files Browse the repository at this point in the history
Fix screen size for DIALOG EditConnectionPreference
  • Loading branch information
bobjacobsen committed Jun 19, 2024
2 parents d63f26a + ea0ce78 commit 58a6220
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion help/en/releasenotes/current-draft-note.shtml
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@
<h3>Preferences</h3>
<a id="Preferences" name="Preferences"></a>
<ul>
<li></li>
<li>Set the bounds on the dialog when going into EditPreferences after profile connection fail.</li>
</ul>

<h3>Resources</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ public boolean isMultipleInstances() {
public static boolean showDialog() {
EditConnectionPreferencesDialog dialog = new EditConnectionPreferencesDialog();
SwingUtilities.updateComponentTreeUI(dialog); // hack because sometimes this was created before L&F was set?

dialog.pack();
dialog.setBounds(
(int) ( jmri.util.JmriJFrame.getScreenDimensions().get(0).getBounds().getSize().getWidth() * 0.10 ),
(int) ( jmri.util.JmriJFrame.getScreenDimensions().get(0).getBounds().getSize().getHeight() * 0.10 ),
(int) ( jmri.util.JmriJFrame.getScreenDimensions().get(0).getBounds().getSize().getWidth() * 0.80 ),
(int) (jmri.util.JmriJFrame.getScreenDimensions().get(0).getBounds().getSize().getHeight()* 0.80 ));
dialog.setVisible(true);
return dialog.restartProgram;
}
Expand Down

0 comments on commit 58a6220

Please sign in to comment.